Firefox PHP

Views Hack v2 Finished, Tested, and working

Posted by Vulpes 

Has anyone got this working as we near 2004 ? I followed the links of the people in the posts above and can't help but notice that the solution for the ones that aren't extinct in the end was to switch to phpBB.

Does anyone have a view counter working in the new version of phorum??

r.


oops.. all cept for tommy. his link was cleverly disguised. gonna try to get him to post his mod here..

r.
Nickwe
Re: Views Hack v2 Finished, Tested, and working
January 03, 2004 01:42PM
Better got to this treat now
[phorum.org]
explanations are more accurate and up to date and it works with my phorum 3.4.4 :-)
[www.astel.be] (French!)
Portuguese MArio
Re: Views Hack v2 Finished, Tested, and working
January 06, 2004 05:46PM
does it works on 3.4.6 ?
Cyril
Re: Views Hack v2 Finished, Tested, and working
January 13, 2004 06:12AM
yes, it works ;)

[jankounenforum.free.fr]
MRT
Does it work on Phorum 5?
January 13, 2004 04:56PM
But does it work on Phorum 5.0.2, anyone ?

Author: guest unknown user

Un hack modifié pour afficher ou tu veux les N nouveaux messages
fonctionnant avec phorum-3.4.6 qui donne cela par ex:

- [28/02 16:59] Test de l'affichage en Index [2].
- [27/02 04:44] Voice-Clone[19]
- [27/02 03:24] mIRC explications [5]


Créer un fichier "cequetuveux.php" et y inscrire:

<?php
$cfgHote = "HOTE";
$cfgUser = "USER";
$cfgPass = "PASSWORD";
$cfgBase = "BASE";

$cfgTable = "TABLE";
$cfgRep = "phorum/";
$cfgRead = "read.php";

$nbMsgForum = 10; // Nbre de discussions à afficher

// connexion à la base
mysql_connect($cfgHote, $cfgUser, $cfgPass);

echo "Les ".$nbMsgForum." dernières discussions - ";

// Nb msg aujourd'hui
$sql = "SELECT COUNT(id) ";
$sql .= "FROM ".$cfgTable." ";
$sql .= "WHERE approved = 'Y' AND datestamp LIKE '".date("Y-m-d")."%'";

$resultat = mysql_db_query($cfgBase, $sql);
$enr = mysql_fetch_array($resultat);

echo "<B>".($nb = $enr[0])."</B> message".($nb > 1 ? "s" : "");
echo " posté".($nb > 1 ? "s" : "")." aujourd'hui";

// Nb msg hier
$date = date("d/m/Y");
$elts = explode("/", $date);
$hier = mktime(0, 0, 0, $elts[1], $elts[0]-1, $elts[2]);

$sql = "SELECT COUNT(id) ";
$sql .= "FROM ".$cfgTable." ";
$sql .= "WHERE approved = 'Y' AND datestamp LIKE '".date("Y-m-d", $hier)."%'";

$resultat = mysql_db_query($cfgBase, $sql);
$enr = mysql_fetch_array($resultat);
echo " [<B>".$enr[0]."</B> hier]";

echo "<BR><BR>\n";

// Affichage des fils de discussion et du nombre de réponses
$sql = "SELECT id,subject,datestamp ";
$sql .= "FROM ".$cfgTable." ";
$sql .= "WHERE approved = 'Y' AND parent = 0 ";
$sql .= "ORDER BY id DESC LIMIT 0,".$nbMsgForum;

$resultat = mysql_db_query($cfgBase, $sql);

while ($message = mysql_fetch_array($resultat)) {

$sql2 = "SELECT count(*) ";
$sql2 .= "FROM ".$cfgTable." ";
$sql2 .= "WHERE approved = 'Y' AND thread=".$message[0]." AND parent <> 0";

$resultat2 = mysql_db_query($cfgBase, $sql2);
$nbRep = mysql_fetch_array($resultat2);

echo " - ";
$date = substr($message[2], 8, 2) . "/";
$date .= substr($message[2], 5, 2) . " ";
$date .= substr($message[2], 11, 5);

echo "[<B>".$date."</B>] ";
if (strlen($message[1]) > 40)
$msg = substr($message[1], 0, 40)." ...";
else
$msg = $message[1];

$lien = $cfgRep.$cfgRead."?f=4&i=0&i=".$message[0]."&t=".$message[0];
echo "<A HREF='".$lien."' TARGET='_self'>".$msg."</A>";

// nb de réponses
if ($nbRep[0] > 0) echo " [".$nbRep[0]."]";

echo "<BR>\n";
}

?>

Pour afficher les discussions sur une page d'index.php:

<?
include ('cequetuveux.php') ;
?>


Sorry i dont speak english, if someone want to translate, THX.
Sorry, you do not have permission to post/reply in this forum.