Przedszkolak
Postów: 32 Ostrzeżeń: 4
v7.02.06 Data rejestracji: 09.04.2006 14:02
|
Czy zna może ktoś mod który dodawałby ulubione artykuły. Np. w artykule byłby link "dodaj do ulubionych", który po dodaniu zmieniałby się na "usuń z ulubionych". Zaś listę ulubionych można by znaleźć w profilu użytkownika. Przeszukałam internet i tutaj forum, nic sensownego lub podobnego do tego co szukam nie znalazłam, a zależy mi bardzo na tym modzie. Będę wdzięczna za pomoc. Niestety sama nie piszę modów więc nie mam szans na stworzenie czegoś takiego. Dziękuję z góry.
Edytuję swój post. Mianowicie dlatego, że znalazłam ciekawy mod ulubionych. Dla mnie jest super. Dodaje panel boczny dzięki któremu dodaje się stronę do ulubionych. Te zaś pojawiają się na osobnej stronie. Mod nosi nazwę "My Favourites". Z czym mam problem, jest on bardzo niewielki. Otóż linki, które dodaje do ulubionych są w takiej postaci "articles.php?article_id=2". Ja chciałabym żeby zamiast linku pokazywało nazwę czy też tytuł linku. Po wejściu do ulubionych widać tylko sznur linków. Ja wolę widzieć tytuł linku. Podaję kod który jest odpowiedzialny za pokazywanie samych linków dodanych stron.
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright Š 2002 - 2012 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: my_favourites.php
| Author: Philip Daly (HobbyMan)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../../maincore.php";
require_once THEMES."templates/header.php";
if (!iMEMBER) { redirect("../../index.php"); }
include INFUSIONS."my_favourites_panel/fav_inc.php";
add_to_title($locale['global_200'].$locale['fv_12'].$settings['sitename'].$locale['fv_13']);
$mypage_count = (dbcount("(ufav_id)", DB_UFAVES, "ufav_user ='".$userdata['user_id']."'"));
if ($mypage_count >= '30') {
add_to_head("<script type='text/javascript' src='".MYFAVES."scroll.js'></script>"); }
//Delete
if ((isset($_GET['action']) && $_GET['action'] == "rem_fav") && (isset($_GET['ufav_id']) && isnum($_GET['ufav_id']))) {
$get_favid = dbarray(dbquery("SELECT ufav_id FROM ".DB_UFAVES." WHERE ufav_id='".$_GET['ufav_id']."' AND ufav_user = '".$userdata['user_id']."'"));
$result = dbquery("DELETE FROM ".DB_UFAVES." WHERE ufav_id='".$get_favid['ufav_id']."'");
redirect(FUSION_SELF);
}
//Up
if ((isset($_GET['action']) && $_GET['action'] == "upfav") && (isset($_GET['ufav_id']) && isnum($_GET['ufav_id']))) {
$get_favid = dbarray(dbquery("SELECT ufav_strength FROM ".DB_UFAVES." WHERE ufav_id='".$_GET['ufav_id']."' AND ufav_user = '".$userdata['user_id']."'"));
$update = dbquery("UPDATE ".DB_UFAVES." SET ufav_strength='".($get_favid['ufav_strength']+1)."' WHERE ufav_id='".$_GET['ufav_id']."'");
redirect(FUSION_SELF);
}
//Down
if ((isset($_GET['action']) && $_GET['action'] == "downfav") && (isset($_GET['ufav_id']) && isnum($_GET['ufav_id']))) {
$get_favid = dbarray(dbquery("SELECT ufav_strength FROM ".DB_UFAVES." WHERE ufav_id='".$_GET['ufav_id']."' AND ufav_user = '".$userdata['user_id']."'"));
$downdate = dbquery("UPDATE ".DB_UFAVES." SET ufav_strength='".($get_favid['ufav_strength']-1)."' WHERE ufav_id='".$_GET['ufav_id']."'");
redirect(FUSION_SELF);
}
$my_hi = (dbcount("(ufav_id)", DB_UFAVES, "ufav_user ='".$userdata['user_id']."' && ufav_strength ='3'"));
$my_md = (dbcount("(ufav_id)", DB_UFAVES, "ufav_user ='".$userdata['user_id']."' && ufav_strength ='2'"));
$my_lw = (dbcount("(ufav_id)", DB_UFAVES, "ufav_user ='".$userdata['user_id']."' && ufav_strength ='1'"));
opentable($locale['fv_03']);
echo "<table class='tbl' border='0' width='100%'>\n<thead><tr>\n";
echo "<td class='tbl1' rowspan='2' width='32'>".$img_faves."</td>\n";
echo "<td class='tbl1' align='center'><h4>".$mypage_count.$locale['fv_13']." ".$locale['fv_09'].". ".sprintf($locale['fv107'], round($mypage_count*100/$max_saves,2)).$max_saves.$locale['fv_08'].".</h4>\n";
if ($mypage_count == $max_saves) { echo "<br /><div class='tbl-error'>".$locale['fv_18']."</div>\n"; }
echo "</td>\n";
echo "</tr></thead><tbody><tr>\n";
echo "<td class='tbl1' colspan='2' align='center'>".$locale['fv101']." (".$my_hi.") | ".$locale['fv102']." (".$my_md.") | ".$locale['fv103']." (".$my_lw.") | ($mypage_count/$max_saves)</td>\n";
echo "</tbody></tr>\n</table>\n";
closetable();
echo "<div class='item' id='top'></div>\n";
// High Priority
opentable($locale['fv101']."<span style='float:right'>".$my_hi."</span>");
$num = 1;
$result = dbquery("SELECT
ufav_id,
ufav_page,
ufav_strength,
ufav_title,
ufav_datestamp
FROM ".DB_UFAVES."
WHERE ufav_user = ".$userdata['user_id']."
AND ufav_strength = '3'
ORDER BY ufav_datestamp
DESC
");
if (dbrows($result)) {
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border center'>\n<thead><tr>\n";
echo "<th colspan='2' >".$locale['fv_07']."</th>\n";
echo "<th>".$locale['fv_09']."</th>\n";
echo "<th>".$img_heart."</th>\n";
echo "<th>".$locale['fv_20']."</th>\n";
echo "<th>".$locale['fv_04']."</th>\n";
echo "</tr>\n</thead>\n";
while ($data = dbarray($result)) {
$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2");
$other_count = (dbcount("(ufav_id)", DB_UFAVES, "ufav_page ='".$data['ufav_page']."' && ufav_user !='".$userdata['user_id']."'"));
echo "<tbody><tr>\n<td width='1%' class='$cell_color'>#".$num."</td>\n";
echo "<td class='$cell_color'><a href='".$data['ufav_page']."' title='".$data['ufav_page']."'>".($data['ufav_title'] != '' ? trimlink($data['ufav_title'],100) : str_replace($settings['siteurl'], " ", $data['ufav_page']))."</a></td>\n";
echo "<td width='80' class='$cell_color' align='center'>".showdate("shortdate", $data['ufav_datestamp'])."</td>\n";
echo "<td width='20' class='$cell_color' align='center'>".$other_count."</td>\n";
echo "<td width='40' class='$cell_color' align='center'><a href='".FUSION_SELF."?ufav_id=".$data['ufav_id']."&action=downfav'>".$img_down."</a></td>\n";
echo "<td width='80' class='$cell_color' align='center'><a href='".FUSION_SELF."?ufav_id=".$data['ufav_id']."&action=rem_fav' onclick='return DeleteFavourite();'>".$img_delete."</a></td>\n";
echo "</tr>\n</tbody>\n";
$i++; $num++;
}
echo "</table>\n";
} else {
echo $locale['fv_05'];
}
closetable();
// Medium Priority
opentable($locale['fv102']."<span style='float:right'>".$my_md."</span>");
$num = 1;
$result = dbquery("SELECT
ufav_id,
ufav_page,
ufav_strength,
ufav_title,
ufav_datestamp
FROM ".DB_UFAVES."
WHERE ufav_user = ".$userdata['user_id']."
AND ufav_strength = '2'
ORDER BY ufav_datestamp
DESC
");
if (dbrows($result)) {
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border center'>\n<thead><tr>\n";
echo "<th colspan='2' >".$locale['fv_07']."</th>\n";
echo "<th>".$locale['fv_09']."</th>\n";
echo "<th>".$img_heart."</th>\n";
echo "<th>".$locale['fv_20']."</th>\n";
echo "<th>".$locale['fv_04']."</th>\n";
echo "</tr></thead>\n";
while ($data = dbarray($result)) {
$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2");
$other_count = (dbcount("(ufav_id)", DB_UFAVES, "ufav_page ='".$data['ufav_page']."' && ufav_user !='".$userdata['user_id']."'"));
echo "<tbody><tr>\n<td width='1%' class='$cell_color'>#".$num."</td>\n";
echo "<td class='$cell_color'><a href='".$data['ufav_page']."' title='".$data['ufav_page']."'>".($data['ufav_title'] != '' ? trimlink($data['ufav_title'],100) : str_replace($settings['siteurl'], " ", $data['ufav_page']))."</a></td>\n";
echo "<td width='80' class='$cell_color' align='center'>".showdate("shortdate", $data['ufav_datestamp'])."</td>\n";
echo "<td width='20' class='$cell_color' align='center'>".$other_count."</td>\n";
echo "<td width='40' class='$cell_color' align='center'><a href='".FUSION_SELF."?ufav_id=".$data['ufav_id']."&action=upfav'>".$img_up."</a><a href='".FUSION_SELF."?ufav_id=".$data['ufav_id']."&action=downfav'>".$img_down."</a></td>\n";
echo "<td width='80' class='$cell_color' align='center'><a href='".FUSION_SELF."?ufav_id=".$data['ufav_id']."&action=rem_fav' onclick='return DeleteFavourite();'>".$img_delete."</a></td>\n";
echo "</tr></tbody>\n";
$i++; $num++;
}
echo "</table>\n";
} else {
echo $locale['fv_05'];
}
closetable();
// Low Priority
opentable($locale['fv103']."<span style='float:right'>".$my_lw."</span>");
$num = 1;
$result = dbquery("SELECT
ufav_id,
ufav_page,
ufav_strength,
ufav_title,
ufav_datestamp
FROM ".DB_UFAVES."
WHERE ufav_user = ".$userdata['user_id']."
AND ufav_strength = '1'
ORDER BY ufav_datestamp
DESC
");
if (dbrows($result)) {
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border center'>\n<thead><tr>\n";
echo "<th colspan='2' >".$locale['fv_07']."</th>\n";
echo "<th>".$locale['fv_09']."</th>\n";
echo "<th>".$img_heart."</th>\n";
echo "<th>".$locale['fv_20']."</th>\n";
echo "<th>".$locale['fv_04']."</th>\n";
echo "</tr></thead>\n";
while ($data = dbarray($result)) {
$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2");
$other_count = (dbcount("(ufav_id)", DB_UFAVES, "ufav_page ='".$data['ufav_page']."' && ufav_user !='".$userdata['user_id']."'"));
echo "<tbody><tr>\n<td width='1%' class='$cell_color'>#".$num."</td>\n";
echo "<td class='$cell_color'><a href='".$data['ufav_page']."' title='".$data['ufav_page']."'>".($data['ufav_title'] != '' ? trimlink($data['ufav_title'],100) : str_replace($settings['siteurl'], " ", $data['ufav_page']))."</a></td>\n";
echo "<td width='80' class='$cell_color' align='center'>".showdate("shortdate", $data['ufav_datestamp'])."</td>\n";
echo "<td width='20' class='$cell_color' align='center'>".$other_count."</td>\n";
echo "<td width='40' class='$cell_color' align='center'><a href='".FUSION_SELF."?ufav_id=".$data['ufav_id']."&action=upfav'>".$img_up."</a></td>\n";
echo "<td width='80' class='$cell_color' align='center'><a href='".FUSION_SELF."?ufav_id=".$data['ufav_id']."&action=rem_fav' onclick='return DeleteFavourite();'>".$img_delete."</a></td>\n";
echo "</tr></tbody>\n";
$i++; $num++;
}
echo "</table>\n";
if ($mypage_count > '30') {
echo "<div class='tbl2' align='center'>".$img_up." <a href='#top' class='current'>".$locale['fv_16']."</a> ".$img_up."</div>\n";
}
} else {
echo $locale['fv_05'];
}
closetable();
require_once THEMES."templates/footer.php";
?>
Gdyby ktoś zechciał wprowadzić dosłownie króciutka zmianę tych linków na ich odpowiedniki w nazwach. Dziękuję.
PW od moderatora:
- Przeniesienie tematu - bogdan 06.07.2013 15:25
- Ogólna uwaga - bogdan 06.07.2013 21:41
mariko dodał/a następującą plik:
Edytowane przez mariko dnia 06.07.2013 20:02:44
|
Bywalec
Postów: 998 Pomógł: 19
v7.02.03 Data rejestracji: 27.04.2006 18:29
|
W załączniku 2 pliczki do podmiany. Zamieniają artykuły i newsy.
Pobieżnie testowane i działa.
Nie biorę za to odpowiedzialności, bo moje umiejętności PHP nie stoją na najwyższym poziomie ;)
Plik my_favourites.php:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright 2002 - 2012 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: my_favourites.php
| Author: Philip Daly (HobbyMan)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../../maincore.php";
require_once THEMES."templates/header.php";
if (!iMEMBER) { redirect("../../index.php"); }
include INFUSIONS."my_favourites_panel/fav_inc.php";
add_to_title($locale['global_200'].$locale['fv_12'].$settings['sitename'].$locale['fv_13']);
$mypage_count = (dbcount("(ufav_id)", DB_UFAVES, "ufav_user ='".$userdata['user_id']."'"));
if ($mypage_count >= '30') {
add_to_head("<script type='text/javascript' src='".MYFAVES."scroll.js'></script>"); }
//Delete
if ((isset($_GET['action']) && $_GET['action'] == "rem_fav") && (isset($_GET['ufav_id']) && isnum($_GET['ufav_id']))) {
$get_favid = dbarray(dbquery("SELECT ufav_id FROM ".DB_UFAVES." WHERE ufav_id='".$_GET['ufav_id']."' AND ufav_user = '".$userdata['user_id']."'"));
$result = dbquery("DELETE FROM ".DB_UFAVES." WHERE ufav_id='".$get_favid['ufav_id']."'");
redirect(FUSION_SELF);
}
//Up
if ((isset($_GET['action']) && $_GET['action'] == "upfav") && (isset($_GET['ufav_id']) && isnum($_GET['ufav_id']))) {
$get_favid = dbarray(dbquery("SELECT ufav_strength FROM ".DB_UFAVES." WHERE ufav_id='".$_GET['ufav_id']."' AND ufav_user = '".$userdata['user_id']."'"));
$update = dbquery("UPDATE ".DB_UFAVES." SET ufav_strength='".($get_favid['ufav_strength']+1)."' WHERE ufav_id='".$_GET['ufav_id']."'");
redirect(FUSION_SELF);
}
//Down
if ((isset($_GET['action']) && $_GET['action'] == "downfav") && (isset($_GET['ufav_id']) && isnum($_GET['ufav_id']))) {
$get_favid = dbarray(dbquery("SELECT ufav_strength FROM ".DB_UFAVES." WHERE ufav_id='".$_GET['ufav_id']."' AND ufav_user = '".$userdata['user_id']."'"));
$downdate = dbquery("UPDATE ".DB_UFAVES." SET ufav_strength='".($get_favid['ufav_strength']-1)."' WHERE ufav_id='".$_GET['ufav_id']."'");
redirect(FUSION_SELF);
}
$my_hi = (dbcount("(ufav_id)", DB_UFAVES, "ufav_user ='".$userdata['user_id']."' && ufav_strength ='3'"));
$my_md = (dbcount("(ufav_id)", DB_UFAVES, "ufav_user ='".$userdata['user_id']."' && ufav_strength ='2'"));
$my_lw = (dbcount("(ufav_id)", DB_UFAVES, "ufav_user ='".$userdata['user_id']."' && ufav_strength ='1'"));
opentable($locale['fv_03']);
echo "<table class='tbl' border='0' width='100%'>\n<thead><tr>\n";
echo "<td class='tbl1' rowspan='2' width='32'>".$img_faves."</td>\n";
echo "<td class='tbl1' align='center'><h4>".$mypage_count.$locale['fv_13']." ".$locale['fv_09'].". ".sprintf($locale['fv107'], round($mypage_count*100/$max_saves,2)).$max_saves.$locale['fv_08'].".</h4>\n";
if ($mypage_count == $max_saves) { echo "<br /><div class='tbl-error'>".$locale['fv_18']."</div>\n"; }
echo "</td>\n";
echo "</tr></thead><tbody><tr>\n";
echo "<td class='tbl1' colspan='2' align='center'>".$locale['fv101']." (".$my_hi.") | ".$locale['fv102']." (".$my_md.") | ".$locale['fv103']." (".$my_lw.") | ($mypage_count/$max_saves)</td>\n";
echo "</tbody></tr>\n</table>\n";
closetable();
echo "<div class='item' id='top'></div>\n";
// High Priority
opentable($locale['fv101']."<span style='float:right'>".$my_hi."</span>");
$num = 1;
$result = dbquery("SELECT
ufav_id,
ufav_page,
ufav_strength,
ufav_title,
ufav_datestamp
FROM ".DB_UFAVES."
WHERE ufav_user = ".$userdata['user_id']."
AND ufav_strength = '3'
ORDER BY ufav_datestamp
DESC
");
if (dbrows($result)) {
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border center'>\n<thead><tr>\n";
echo "<th colspan='2' >".$locale['fv_07']."</th>\n";
echo "<th>".$locale['fv_09']."</th>\n";
echo "<th>".$img_heart."</th>\n";
echo "<th>".$locale['fv_20']."</th>\n";
echo "<th>".$locale['fv_04']."</th>\n";
echo "</tr>\n</thead>\n";
while ($data = dbarray($result)) {
$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2");
$other_count = (dbcount("(ufav_id)", DB_UFAVES, "ufav_page ='".$data['ufav_page']."' && ufav_user !='".$userdata['user_id']."'"));
echo "<tbody><tr>\n<td width='1%' class='$cell_color'>#".$num."</td>\n";
//POCZĄTEK
$krotki = str_replace($settings['siteurl'], " ", $data['ufav_page']);
//artykuły
if(strstr($krotki, "article_id") !== FALSE) {
$b = substr($krotki, 25);
$result2 = dbquery("SELECT
article_subject
FROM ".DB_PREFIX."articles"."
WHERE article_id=".$b."
");
while ($data2 = dbarray($result2)) {
echo "<td class='$cell_color'><a href='".$data['ufav_page']."'>".$data2['article_subject']."</a></td>\n";
}
} else if(strstr($krotki, "readmore") !== FALSE) {
//newsy
$b = substr($krotki, 19);
$result2 = dbquery("SELECT
news_subject
FROM ".DB_PREFIX."news"."
WHERE news_id=".$b."
");
while ($data2 = dbarray($result2)) {
echo "<td class='$cell_color'><a href='".$data['ufav_page']."'>".$data2['news_subject']."</a></td>\n";
}
} else
{
echo "<td class='$cell_color'><a href='".$data['ufav_page']."'>".str_replace($settings['siteurl'], " ", $data['ufav_page'])."</a></td>\n";
}
//KONIEC
//echo "<td class='$cell_color'><a href='".$data['ufav_page']."' title='".$data['ufav_page']."'>".($data['ufav_title'] != '' ? trimlink($data['ufav_title'],100) : str_replace($settings['siteurl'], " ", $data['ufav_page']))."</a></td>\n";
echo "<td width='80' class='$cell_color' align='center'>".showdate("shortdate", $data['ufav_datestamp'])."</td>\n";
echo "<td width='20' class='$cell_color' align='center'>".$other_count."</td>\n";
echo "<td width='40' class='$cell_color' align='center'><a href='".FUSION_SELF."?ufav_id=".$data['ufav_id']."&action=downfav'>".$img_down."</a></td>\n";
echo "<td width='80' class='$cell_color' align='center'><a href='".FUSION_SELF."?ufav_id=".$data['ufav_id']."&action=rem_fav' onclick='return DeleteFavourite();'>".$img_delete."</a></td>\n";
echo "</tr>\n</tbody>\n";
$i++; $num++;
}
echo "</table>\n";
} else {
echo $locale['fv_05'];
}
closetable();
// Medium Priority
opentable($locale['fv102']."<span style='float:right'>".$my_md."</span>");
$num = 1;
$result = dbquery("SELECT
ufav_id,
ufav_page,
ufav_strength,
ufav_title,
ufav_datestamp
FROM ".DB_UFAVES."
WHERE ufav_user = ".$userdata['user_id']."
AND ufav_strength = '2'
ORDER BY ufav_datestamp
DESC
");
if (dbrows($result)) {
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border center'>\n<thead><tr>\n";
echo "<th colspan='2' >".$locale['fv_07']."</th>\n";
echo "<th>".$locale['fv_09']."</th>\n";
echo "<th>".$img_heart."</th>\n";
echo "<th>".$locale['fv_20']."</th>\n";
echo "<th>".$locale['fv_04']."</th>\n";
echo "</tr></thead>\n";
while ($data = dbarray($result)) {
$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2");
$other_count = (dbcount("(ufav_id)", DB_UFAVES, "ufav_page ='".$data['ufav_page']."' && ufav_user !='".$userdata['user_id']."'"));
echo "<tbody><tr>\n<td width='1%' class='$cell_color'>#".$num."</td>\n";
//POCZĄTEK
$krotki = str_replace($settings['siteurl'], " ", $data['ufav_page']);
//artykuły
if(strstr($krotki, "article_id") !== FALSE) {
$b = substr($krotki, 25);
$result2 = dbquery("SELECT
article_subject
FROM ".DB_PREFIX."articles"."
WHERE article_id=".$b."
");
while ($data2 = dbarray($result2)) {
echo "<td class='$cell_color'><a href='".$data['ufav_page']."'>".$data2['article_subject']."</a></td>\n";
}
} else if(strstr($krotki, "readmore") !== FALSE) {
//newsy
$b = substr($krotki, 19);
$result2 = dbquery("SELECT
news_subject
FROM ".DB_PREFIX."news"."
WHERE news_id=".$b."
");
while ($data2 = dbarray($result2)) {
echo "<td class='$cell_color'><a href='".$data['ufav_page']."'>".$data2['news_subject']."</a></td>\n";
}
} else
{
echo "<td class='$cell_color'><a href='".$data['ufav_page']."'>".str_replace($settings['siteurl'], " ", $data['ufav_page'])."</a></td>\n";
}
//KONIEC
//echo "<td class='$cell_color'><a href='".$data['ufav_page']."' title='".$data['ufav_page']."'>".($data['ufav_title'] != '' ? trimlink($data['ufav_title'],100) : str_replace($settings['siteurl'], " ", $data['ufav_page']))."</a></td>\n";
echo "<td width='80' class='$cell_color' align='center'>".showdate("shortdate", $data['ufav_datestamp'])."</td>\n";
echo "<td width='20' class='$cell_color' align='center'>".$other_count."</td>\n";
echo "<td width='40' class='$cell_color' align='center'><a href='".FUSION_SELF."?ufav_id=".$data['ufav_id']."&action=upfav'>".$img_up."</a><a href='".FUSION_SELF."?ufav_id=".$data['ufav_id']."&action=downfav'>".$img_down."</a></td>\n";
echo "<td width='80' class='$cell_color' align='center'><a href='".FUSION_SELF."?ufav_id=".$data['ufav_id']."&action=rem_fav' onclick='return DeleteFavourite();'>".$img_delete."</a></td>\n";
echo "</tr></tbody>\n";
$i++; $num++;
}
echo "</table>\n";
} else {
echo $locale['fv_05'];
}
closetable();
// Low Priority
opentable($locale['fv103']."<span style='float:right'>".$my_lw."</span>");
$num = 1;
$result = dbquery("SELECT
ufav_id,
ufav_page,
ufav_strength,
ufav_title,
ufav_datestamp
FROM ".DB_UFAVES."
WHERE ufav_user = ".$userdata['user_id']."
AND ufav_strength = '1'
ORDER BY ufav_datestamp
DESC
");
if (dbrows($result)) {
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border center'>\n<thead><tr>\n";
echo "<th colspan='2' >".$locale['fv_07']."</th>\n";
echo "<th>".$locale['fv_09']."</th>\n";
echo "<th>".$img_heart."</th>\n";
echo "<th>".$locale['fv_20']."</th>\n";
echo "<th>".$locale['fv_04']."</th>\n";
echo "</tr></thead>\n";
while ($data = dbarray($result)) {
$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2");
$other_count = (dbcount("(ufav_id)", DB_UFAVES, "ufav_page ='".$data['ufav_page']."' && ufav_user !='".$userdata['user_id']."'"));
echo "<tbody><tr>\n<td width='1%' class='$cell_color'>#".$num."</td>\n";
//POCZĄTEK
$krotki = str_replace($settings['siteurl'], " ", $data['ufav_page']);
//artykuły
if(strstr($krotki, "article_id") !== FALSE) {
$b = substr($krotki, 25);
$result2 = dbquery("SELECT
article_subject
FROM ".DB_PREFIX."articles"."
WHERE article_id=".$b."
");
while ($data2 = dbarray($result2)) {
echo "<td class='$cell_color'><a href='".$data['ufav_page']."'>".$data2['article_subject']."</a></td>\n";
}
} else if(strstr($krotki, "readmore") !== FALSE) {
//newsy
$b = substr($krotki, 19);
$result2 = dbquery("SELECT
news_subject
FROM ".DB_PREFIX."news"."
WHERE news_id=".$b."
");
while ($data2 = dbarray($result2)) {
echo "<td class='$cell_color'><a href='".$data['ufav_page']."'>".$data2['news_subject']."</a></td>\n";
}
} else
{
echo "<td class='$cell_color'><a href='".$data['ufav_page']."'>".str_replace($settings['siteurl'], " ", $data['ufav_page'])."</a></td>\n";
}
//KONIEC
//echo "<td class='$cell_color'><a href='".$data['ufav_page']."' title='".$data['ufav_page']."'>".($data['ufav_title'] != '' ? trimlink($data['ufav_title'],100) : str_replace($settings['siteurl'], " ", $data['ufav_page']))."</a></td>\n";
echo "<td width='80' class='$cell_color' align='center'>".showdate("shortdate", $data['ufav_datestamp'])."</td>\n";
echo "<td width='20' class='$cell_color' align='center'>".$other_count."</td>\n";
echo "<td width='40' class='$cell_color' align='center'><a href='".FUSION_SELF."?ufav_id=".$data['ufav_id']."&action=upfav'>".$img_up."</a></td>\n";
echo "<td width='80' class='$cell_color' align='center'><a href='".FUSION_SELF."?ufav_id=".$data['ufav_id']."&action=rem_fav' onclick='return DeleteFavourite();'>".$img_delete."</a></td>\n";
echo "</tr></tbody>\n";
$i++; $num++;
}
echo "</table>\n";
if ($mypage_count > '30') {
echo "<div class='tbl2' align='center'>".$img_up." <a href='#top' class='current'>".$locale['fv_16']."</a> ".$img_up."</div>\n";
}
} else {
echo $locale['fv_05'];
}
closetable();
require_once THEMES."templates/footer.php";
?>
Plik admin/my_favourites_admin.php:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright 2002 - 2012 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: my_favourites_admin.php
| Author: Philp Daly (HobbyMan)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../../../maincore.php";
require_once THEMES."templates/admin_header.php";
include INFUSIONS."my_favourites_panel/fav_inc.php";
if (!checkrights("MFP") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("../index.php"); }
add_to_title($locale['global_200'].$locale['fv104']);
$entry_limit = "30";
$total_count = (dbcount("(ufav_id)", DB_UFAVES));
if (isset($_GET['rowstart']) && isnum($_GET['rowstart'])) {
$rowstart = $_GET['rowstart'];
} else {
$rowstart = 0; }
opentable($locale['fv104']);
$num = $rowstart+1;
$result = dbquery("SELECT
ufav_id,
ufav_page,
ufav_strength,
COUNT(ufav_id)
count, ufav_page page
FROM ".DB_UFAVES."
GROUP BY ufav_page
ORDER BY count
DESC LIMIT $rowstart,$entry_limit
");
if (dbrows($result)) {
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border center'>\n<tr>\n";
echo "<th colspan='2'>".$locale['fv_07']."</th>\n";
echo "<th>".$locale['fv101']."</th>\n";
echo "<th>".$locale['fv102']."</th>\n";
echo "<th>".$locale['fv103']."</th>\n";
echo "<th>".$locale['fv105']."</th>\n";
echo "</tr>\n";
while ($data = dbarray($result)) {
$page_count = (dbcount("(ufav_id)", DB_UFAVES, "ufav_page ='".$data['ufav_page']."'"));
$page_high = (dbcount("(ufav_id)", DB_UFAVES, "ufav_page ='".$data['ufav_page']."' && ufav_strength ='3'"));
$page_medium = (dbcount("(ufav_id)", DB_UFAVES, "ufav_page ='".$data['ufav_page']."' && ufav_strength ='2'"));
$page_low = (dbcount("(ufav_id)", DB_UFAVES, "ufav_page ='".$data['ufav_page']."' && ufav_strength ='1'"));
$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2");
echo "<tr>\n<td class='$cell_color'>#".$num."</td>\n";
//POCZĄTEK
$krotki = str_replace($settings['siteurl'], " ", $data['ufav_page']);
//artykuły
if(strstr($krotki, "article_id") !== FALSE) {
$b = substr($krotki, 25);
$result2 = dbquery("SELECT
article_subject
FROM ".DB_PREFIX."articles"."
WHERE article_id=".$b."
");
while ($data2 = dbarray($result2)) {
echo "<td class='$cell_color'><a href='".$data['ufav_page']."'>".$data2['article_subject']."</a></td>\n";
}
} else if(strstr($krotki, "readmore") !== FALSE) {
//newsy
$b = substr($krotki, 19);
$result2 = dbquery("SELECT
news_subject
FROM ".DB_PREFIX."news"."
WHERE news_id=".$b."
");
while ($data2 = dbarray($result2)) {
echo "<td class='$cell_color'><a href='".$data['ufav_page']."'>".$data2['news_subject']."</a></td>\n";
}
} else
{
echo "<td class='$cell_color'><a href='".$data['ufav_page']."'>".str_replace($settings['siteurl'], " ", $data['ufav_page'])."</a></td>\n";
}
//KONIEC
echo "<td class='$cell_color' align='center'>".$page_high."</td>\n";
echo "<td class='$cell_color' align='center'>".$page_medium."</td>\n";
echo "<td class='$cell_color' align='center'>".$page_low."</td>\n";
echo "<td class='$cell_color' align='center'>(".$page_count.")</td>\n</tr>\n";
$i++; $num++;
}
echo "</table>\n";
} else {
echo "<br /><center>".$locale['fv106']."</center><br />\n";
}
closetable();
if ($total_count > $entry_limit) { echo "<div align='center' style='margin-top:5px;'>\n".makepagenav($rowstart,$entry_limit,$total_count,3,FUSION_SELF.$aidlink."&")."</div>"; }
//Do Not Remove ##
echo $fv_footer;
//################
require_once THEMES."templates/footer.php";
?>
Edytowane przez Piotrroger dnia 17.08.2013 18:17:47
|