Dziwny problem, po przeniesieniu na nowy hosting nie działa "chyba" mod movie online (nie pamiętam skąd ściągałem), działał dobrze na poprzednim hostingu, na nowym już nie. Problem polega na tym że o ile po kliknięciu na np: film.php?cat_id=x wyświetla w pasku adresu odnośnik, treść już nie, widnieje cały czas treść dla film.php.
PHP Fusion V7.00.07 (zarówno na poprzednim jak i nowy hostingu)
PHP na hostingu: 5.2.9 (podobnie ta sama wersja)
Kod pliku film.php poniżej:
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."film.php";
if (!isset($_GET['cat_id']) || !isnum($_GET['cat_id'])) {
$result = dbquery("SELECT * FROM ".$db_prefix."film_cats WHERE ".groupaccess('film_cat_access')." AND film_cat_sub='0' ORDER BY film_cat_name");
$rows = dbrows($result);
if ($rows != 0) {
$counter = 0; $columns = 1;
add_to_title($locale['global_200']."Klipy / nagrania");
opentable("Klipy / nagrania");
while ($data = dbarray($result)) {
$num = dbcount("(film_cat)", "fusion_film", "film_cat='".$data['film_cat_id']."'");
echo "<table cellpadding='0' cellspacing='0' class='weblink'>\n<tr>\n<td align='left' valign='top'><img src='images/square.gif' style='vertical-align:middle;border:0;' alt='' /> <B><a href='".FUSION_SELF."?cat_id=".$data['film_cat_id']."'>".$data['film_cat_name']."</a></B> <span class='dysk1'>($num)</span><br />\n";
if ($data['film_cat_description'] != "") echo "<p style='color:#999999; text-align:justify;'>".$data['film_cat_description']."</p>";
$subs = dbquery("select * from ".$db_prefix."film_cats WHERE film_cat_sub='".$data['film_cat_id']."'");
if(dbrows($subs)){
$i = dbrows($subs);
echo "<br>";
while($sub = dbarray($subs)){
$subnum = dbcount("(film_cat)", "fusion_film", "film_cat='".$sub['film_cat_id']."'");
echo "<a href='".FUSION_SELF."?cat_id=".$sub['film_cat_id']."'>".$sub['film_cat_name']."</a> ($subnum)";
$i--;
if($i > 0) echo ", ";
}
echo "<br><br></span>";
}
echo "</td>\n</tr>\n</table>\n<br /><br />\n";
$counter++;
}
closetable();
} else {
echo "<center><br>\n".$locale['401']."<br><br>\n</center>\n";
}
} else {
$res = 0;
if (!isNum($cat_id)) fallback(FUSION_SELF);
$result = dbquery("SELECT * FROM ".$db_prefix."film_cats WHERE film_cat_id='$cat_id'");
if (dbrows($result) != 0) {
$cdata = dbarray($result);
if (checkgroup($cdata['film_cat_access'])) {
$res = 1;
$subs = dbquery("select * from ".$db_prefix."film_cats WHERE film_cat_sub='".$cat_id."'");
if(dbrows($subs)){
$counter = 0; $columns = 2;
opentable("Subcategories");
$i = dbrows($subs);
echo "<table cellpadding='0' cellspacing='0' width='100%' class='tbl'>\n<tr>\n";
while($sub = dbarray($subs)){
if ($counter != 0 && ($counter % $columns == 0)) echo "</tr>\n<tr>\n";
$subnum = dbcount("(film_cat)", "fusion_film", "film_cat='".$sub['film_cat_id']."'");
echo "<td align='left' valign='top' width='50%'>
<b><a href='".FUSION_SELF."?cat_id=".$sub['film_cat_id']."'>".$sub['film_cat_name']."</a></b> ($subnum)<Br />
<span class='small'>".trimlink($sub['film_cat_description'], 45)."</span>";
echo "</td>\n";
$counter++;
}
echo "</tr>\n</table>\n";
closetable();
}
add_to_title($locale['global_200'].$cdata['film_cat_name']);
opentable($cdata['film_cat_name']);
$rows = dbcount("(film_id)", "fusion_film", "film_cat='$cat_id'");
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows != 0) {
$result = dbquery("SELECT * FROM ".$db_prefix."film WHERE film_cat='$cat_id' ORDER BY ".$cdata['film_cat_sorting']." LIMIT $rowstart,14");
$numrows = dbrows($result); $i = 1;
while ($data = dbarray($result)) {
if ($data['film_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " <span class='red'>[".$locale['402']."]</span>";
} else {
$new = "";
}
$count = dbcount("(comment_id)", "fusion_comments", "comment_type='W' AND comment_item_id='".$data['film_id']."'");
echo "<table border='0' width='100%'>
<tr>
<td width='122'>
<a href='filmy.php?film_id=".$data['film_id']."'><img src='".$data['film_miniaturka']."' width='120' height='120' border='0'></a>
</td>
<td>
<table border='0' width='100%'>
<tr>
<td width='100%'>
<a href='filmy.php?film_id=".$data['film_id']."'>".$data['film_subject']."</a>$new
</td>
</tr>
<tr>
<td width='100%'>
<br /><img src='images/square.gif' style='vertical-align:middle;border:0;' alt='' /> <b>Komentarzy: </b>";
if ($count) {
echo "".$count."";
} else {
echo "Brak";
}
echo "</td>
</tr>
<tr>";
$wynik = dbquery("SELECT SUM(rating_vote) FROM ".$db_prefix."ratings WHERE rating_type='W' AND rating_item_id='".$data['film_id']."'");
$info = dbresult($wynik,0);
$num_rating = dbcount("(rating_vote)", "fusion_ratings", "rating_type='W' AND rating_item_id='".$data['film_id']."'");
$wyn_rating = ($num_rating ? $info / $num_rating : 0);
echo "<td><img src='images/square.gif' style='vertical-align:middle;border:0;' alt='' /> <b>Ocena: </b>";
if ($wyn_rating) {
echo "".ceil($wyn_rating)."";
} else {
echo "Brak";
}
echo "</tr>
<tr>
<td width='100%'>
<img src='images/square.gif' style='vertical-align:middle;border:0;' alt='' /> <b>Ilo¶ć wy¶wietleń:</b> ".$data['film_reads']."
</td>
</tr>
<tr>
<td width='100%'><img src='images/square.gif' style='vertical-align:middle;border:0;' alt='' /> ";
echo $locale['404'].showdate("shortdate", $data['film_datestamp'])."<br>\n";
echo "</td>
</tr>\n";
echo "
</table>
</td>
</tr>
</table>";
echo ($i != $numrows ? "<br>\n" : "\n"); $i++;
}
closetable();
if ($rows > 14) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,14,$rows,3,FUSION_SELF."?cat_id=$cat_id&")."\n</div>\n";
} else {
echo "<center>".$locale['403']."</center>\n";
closetable();
}
}
}
if ($res == 0) redirect(FUSION_SELF);
}
require_once THEMES."templates/footer.php";
Byłbym wdzięczny za chociaż wskazówki w czym może tkwić problem lub co mogło zostać wyłączone w php.ini.
EDIT - Nieaktualne
Pospieszyłem się, a problem leżał w "$film" zamiast "$_GET['film_id']" i w dalszej kolejności z podstronami - rowstart. Pośpiech jest jednak nie wskazany.
PW od moderatora:
- Przeniesienie tematu - Pieka 25.01 - 10:54
Edytowane przez eldiablo dnia 25.01.2010 17:49:36
|