Plugin di cache non funzionanti
-
-
Basta che le metti subito dopo che assegni la variabile:
<? $ris_query = "SELECT topic_poster, topic_id, topic_title, username FROM phpbb_topics INNER JOIN phpbb_users ON topic_poster = user_id WHERE forum_id!=10 AND forum_id!=9 ORDER BY topic_time DESC LIMIT 7"; $db = mysql_connect("xxxxx","xxxxx","xxxxx"); $res = mysql_db_query("xxxxx",$ris_query) or die('errore'); $num_righe = mysql_num_rows($res); ?> <? if($num_righe > 0) { ?> <table border="0" cellpadding="0" cellspacing="0"> <? $i = 0; while($i < $num_righe) { $topic_id = mysql_result($res,$i,"topic_id"); $topic_title = mysql_result($res,$i,"topic_title"); if (strlen($topic_title)>27) $topic_title = substr($topic_title,0,24) . '...'; $username = mysql_result($res,$i,"username"); $topic_poster = mysql_result($res,$i,"topic_poster"); echo "<tr>"; echo "<td><a href=\"http://www.tuosito.com/forum/viewtopic.php?t=$topic_id\" target=\"_blank\" title=\"$topic_title\" class='link_2'>$topic_title</td>"; echo "</tr>"; echo "<tr>"; echo "<td>posted by: <a href=\"http://www.tuosito.com/forum/profile.php?mode=viewprofile&u=$topic_poster\" target=\"_blank\" title=\"$username\" class='link_2'>$username</td>"; echo "</tr>"; echo "<tr>"; echo "<td></td>"; echo "</tr>"; $i++; } ?> </table> <? } else echo "Nessun topic presente"; ?> -
-
-
vision82
Ciao, piccola domanda da profano....ho provato lo script funziona perfettamente ma il problema che mi visualizza anche i post che vengono scritti nell'area dei moderatori, come faccio ad escludere quei post?
SPero non sia troppo banale

Mi auto quoto, qualcuno sa rispondere?
-
Ciao vision82.
Cerca nel tuo script questo pezzo di codiceuser_id WHERE forum_id!=0e prova ad aggiungere
AND forum_id!=xdove x sarà il numero ID della sezione moderatori sul tuo forum.
Il codice finale sarà qualcosa del tipo:
user_id WHERE forum_id!=0 AND forum_id!=x
-
-
-
-
alive
giorgio tu ce l'hai sul tuo sito, ci metti due sec a rispondermi
per favore !Si ovvio

Solamente che mi è sfuggito questo topic, ogni tanto salto qualche forum da leggere.
Metti al posto del LIMIT 10
LIMIT 11, 100
Prova
-
-
-
-
-
Ok! Comincio a capire!
Ho fatto un file .php con dentro questo codice:<?
error_reporting(E_ALL);
echo "WOW !!!";
mysql_connect("localhost", "[Utente]", "[password]");
mysql_select_db("phpbb");$sql="SELECT * FROM phpbb_posts_text WHERE post_subject!='' ORDER BY post_id DESC LIMIT 10";
$risultati=mysql_query($sql);
while($riga=mysql_fetch_array($risultati)) {
$target=$riga["post_subject"];
$target1=$riga["post_id"];
echo"<a href="http://www.terminillo.org/viewtopic.php?p=$target1\" title="">$target</a>
";
}//Fine del while
?>ma mi mostra solo la scritta "WOW!!!"
Please, HELP ME! Dove sbaglio ora?Tarivor
Scusate, è il mio primo post, e faccio una domanda sicuramente molto stupida in quanto non so nulla di php.
Ma che vuol dire mettere quel codice in homepage? Se non dentro un html, dove non funziona, dove?
-
Ho trovato questo errore nell'error.log
[Fri Jun 23 10:48:49 2006] [error] [client xxx.xxx.xxx.xxx] PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/terminillo.org/httpdocs/ForumIndex.php on line 9

-
Tarivor
Ho trovato questo errore nell'error.log
[Fri Jun 23 10:48:49 2006] [error] [client xxx.xxx.xxx.xxx] PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/terminillo.org/httpdocs/ForumIndex.php on line 9

Ok! Ho risolto da solo! Mi ero dimenticato di valorizzare il nome del Database e la tabella si chiamava diversamente.

-
Buongiorno, io ho aggiunto l'ultimo utente registrato per necessità del cliente.
Funziona, chiedo a chi ne sa di più se è corretto... sono novella in php .<?php require("db_connect.php");
// Inizio ultimo utente registrato
$sql="SELECT * FROMphpbb_usersORDER BYuser_idDESC LIMIT 0 , 1";
$risultati=mysql_query($sql);
while($riga=mysql_fetch_array($risultati)) {$username=$riga["username"]; echo "Ultimo utente registrato: <a href=\"http://{$_SERVER['HTTP_HOST']}/forum/profile.php?mode=viewprofile&u=$username\">$username</a><hr>";}
// Fine ultimo utente registrato// Inizio ultimi post
$sql="SELECT * FROM phpbb_topics inner join phpbb_posts_text on topic_first_post_id = post_id WHERE forum_id!=0 ORDER BY topic_id DESC LIMIT 10";$risultati=mysql_query($sql); while($riga=mysql_fetch_array($risultati)) { $target=$riga["topic_title"]; $target1=$riga["topic_id"]; $visto=$riga["topic_views"]; $testo=$riga["post_text"]; $username=$riga["post_text"]; echo"<span><a href=\"http://{$_SERVER['HTTP_HOST']}/forum/viewtopic.php?t=$target1\" title=\"$target\">$target</a><br />".truncate($testo,100)."<br /></span>";
}
// Fine ultimi post
?> -
Salve a tutti, seguo da anni questo sito ed ho sempre trovato informazioni utili senza chiedere
intanto mi presento, mi chiamo Rino e son davvero felice di far parte di questo forum...Oggi ho installato un modulo sul mio Joomla, le funzioni fondamentali ci stanno
ma avrei bisogno di due piccoli aiutini, ma io e php non siamo molto amici, quindi chiedo il vostro prezioso aiuto 
Questo è il codice .
<?php defined('_JEXEC') or die('Restricted access'); global $mainframe, $headtag; $type = intval( $params->get( 'type', 1 ) ); $count = intval( $params->get( 'count', 5 ) ); $catid = trim( $params->get( 'catid' ) ); $secid = trim( $params->get( 'secid' ) ); $show_front = $params->get( 'show_front', 1 ); $urlPath = "".$_SERVER['SERVER_NAME']."/forum"; $urlImg = "".$_SERVER['SERVER_NAME']."/forum/templates/subSilver/images/folder_new_big.gif"; $phpbb_root_path = 'forum/'; define('IN_PHPBB', true); $table_prefix = "phpbb_"; $table_topics = $table_prefix. "topics"; $table_forums = $table_prefix. "forums"; $table_posts = $table_prefix. "posts"; $table_users = $table_prefix. "users"; $query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username FROM $table_topics t, $table_forums f, $table_posts p, $table_users u WHERE t.topic_id = p.topic_id AND f.forum_id = t.forum_id AND t.topic_status <> 2 AND p.post_id = t.topic_last_post_id AND p.poster_id = u.user_id ORDER BY p.post_id DESC LIMIT $count"; $result = mysql_query($query) or die($query); echo "<ul>"; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<li><a href=\"".$urlPath."/viewtopic.php?p=".$row['post_id']."#".$row['post_id']."\">".$row["topic_title"]."</a> inserito da <a href=\"".$urlPath."/memberlist.php?mode=viewprofile&u=".$row['user_id']."\">".$row['username']."</a></li>"; } echo "</ul>"; mysql_free_result($result); ?>Le due richieste sono...
- (fondamentale XD) inserire un limite di caratteri nel titolo

- Qui proprio mi trovo OUT

Quando clikko sul link, vengo direzionato alla 1 pag del topic, e non al post

Spero in voi .
Saluti

- (fondamentale XD) inserire un limite di caratteri nel titolo
-
Ciao a tutti, scusate se riesumo il topic ma non riesco a risolver eun problema...mi da questo errore:
[phpBB Debug] PHP Notice: in file c : /programmi/easyphp1-8/w w w/mio/wp-content/themes/ wrastle-10/ index.php on line 37: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
Dopo aver aggiunto:
<? include("forum /db_connect.php"); // Inizio ultimo utente registrato $sql="SELECT * FROM `phpbb_users` ORDER BY `user_id` DESC LIMIT 0 , 1"; $risultati=mysql_query($sql); while($riga=mysql_fetch_array($risultati)) { $username=$riga["username"]; echo "Ultimo utente registrato: <a href=\"h t t p ://{$_SERVER['H T T P_HOST']} /for um/profile.php?mode=viewprofile&u=$username\">$userna me</a><hr>"; } // Fine ultimo utente registrato // Inizio ultimi post $sql="SELECT * FROM phpbb_topics inner join phpbb_posts_text on topic_first_post_id = post_id WHERE forum_id!=0 ORDER BY topic_id DESC LIMIT 10"; $risultati=mysql_query($sql); while($riga=mysql_fetch_array($risultati)) { $target=$riga["topic_title"]; $target1=$riga["topic_id"]; $visto=$riga["topic_views"]; $testo=$riga["post_text"]; $username=$riga["post_text"]; echo"<span><a href=\"h t t p :// {$_SERVER['HTTP_HOST']} /forum/viewtopic.php?t=$target1\" title=\"$target\">$target</a><br /> ".truncate($testo,100)."<br /></span>"; } // Fine ultimi post ?>Il db_connect è:
<?php mysql_connect("localhost", "root", "root"); mysql_select_db("mio"); function truncate($text, $chars) { $text = $text." "; $text = substr($text,0,$chars); $text = substr($text,0,strrpos($text,' ')); $text = $text."..."; return $text; } ?>kikko088
Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.
Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.
Con il tuo contributo, questo post potrebbe essere ancora migliore 💗
Registrati Accedi