Home
>
Outdated forums
>
Phorum 3 forums (READ ONLY)
>
Finished Mods and Plug-ins (READ ONLY)
>
Topic
>
Page 2
[it works] VIEWS HACK for 3.4.1-stable
Posted by c0330
Re: [it works] VIEWS HACK for 3.4.1-stable February 04, 2004 03:31PM |
A suggestion for threads.php, this will sum up all views that the particular thread has got (right now, in the thread-view there are only viewcounts for the first message of that thread)
REPLACE line 77 and following in include/threads.php:
else{
$t_subject="<a href=\"$read_page.$ext?f=$num&i=$t_id&t=$t_thread$GetVars\">$t_subject</a>";
}
WITH:
else{
$sSQL="SELECT SUM(views) as summe FROM $ForumTableName WHERE thread='$t_thread'";
$q->query($DB, $sSQL);
$aryRow=$q->getrow();
$t_hits = $aryRow["summe"];
if (!isset($t_hits)) $t_hits=0;
$t_subject="<a href=\"$read_page.$ext?f=$num&i=$t_id&t=$t_thread$GetVars\">$t_subject</a> ($t_hits $lHits)";
}
This will work in Phorum 3.4.6.
Hope this helps,
Marian
REPLACE line 77 and following in include/threads.php:
else{
$t_subject="<a href=\"$read_page.$ext?f=$num&i=$t_id&t=$t_thread$GetVars\">$t_subject</a>";
}
WITH:
else{
$sSQL="SELECT SUM(views) as summe FROM $ForumTableName WHERE thread='$t_thread'";
$q->query($DB, $sSQL);
$aryRow=$q->getrow();
$t_hits = $aryRow["summe"];
if (!isset($t_hits)) $t_hits=0;
$t_subject="<a href=\"$read_page.$ext?f=$num&i=$t_id&t=$t_thread$GetVars\">$t_subject</a> ($t_hits $lHits)";
}
This will work in Phorum 3.4.6.
Hope this helps,
Marian
Re: [it works] VIEWS HACK for 3.4.1-stable February 05, 2004 10:37AM |
An addition to my post from yesterday:
My code will display the number of views right after the subject but not in a special column (as does the original code for the views-hack). You also need to define the language variable $lHits (in my case, it says " x gelesen" for " x read").
Cheers,
Marian
My code will display the number of views right after the subject but not in a special column (as does the original code for the views-hack). You also need to define the language variable $lHits (in my case, it says " x gelesen" for " x read").
Cheers,
Marian
Re: [it works] VIEWS HACK for 3.4.1-stable February 11, 2004 06:30PM |
Hi,
I've some problems with the SQL part, that's because om still a newby when we talking about SQL.
Where do I use :
ALTER TABLE <forumname> ADD views INT(7) DEFAULT '0';
Is this in the phpMyAdmin, and use it like a SQL query ? Or is there a programm to change this easy. I know something about databases, but have some probs with MySQL.
I'm using Windows 2000 with :
- phpMyAdmin Database Manager Version 2.5.4
- Apache WebServer Version 1.3.29
- PHP Script Language Version 4.3.4
- MySQL Database Version 4.0.16
grtz,
Sammy
I've some problems with the SQL part, that's because om still a newby when we talking about SQL.
Where do I use :
ALTER TABLE <forumname> ADD views INT(7) DEFAULT '0';
Is this in the phpMyAdmin, and use it like a SQL query ? Or is there a programm to change this easy. I know something about databases, but have some probs with MySQL.
I'm using Windows 2000 with :
- phpMyAdmin Database Manager Version 2.5.4
- Apache WebServer Version 1.3.29
- PHP Script Language Version 4.3.4
- MySQL Database Version 4.0.16
grtz,
Sammy
Re: [it works] VIEWS HACK for 3.4.1-stable February 11, 2004 07:10PM |
Re: [it works] VIEWS HACK for 3.4.1-stable April 11, 2004 11:19AM |
Very useful thanks a lot to the hackers
i don't know where i got wrong but it seems to count per 2 ???
I'm using new phorum 3.4.7 :
[permutation.free.fr]
('i still have a CSS problem wih forum tables integration in IE )
i don't know where i got wrong but it seems to count per 2 ???
I'm using new phorum 3.4.7 :
[permutation.free.fr]
('i still have a CSS problem wih forum tables integration in IE )
Re: [it works] VIEWS HACK for 3.4.1-stable July 08, 2004 11:47AM |
Registered: 20 years ago Posts: 3 |
Re: [it works] VIEWS HACK for 3.4.1-stable July 12, 2004 04:32PM |
Re: [it works] VIEWS HACK for 3.4.1-stable August 13, 2004 12:01PM |
Registered: 20 years ago Posts: 144 |
Great hack!!! You saved me a whole lot of time. :)
I have created an installer zip file for this hack for Phorum Version 3.4.8a (with all the changes already added to it). If anyone else needs it, you can download it from here:
phorum-3.4.8a_views_hack.zip
Post Edited (08-13-04 11:01)
regards
mt
I have created an installer zip file for this hack for Phorum Version 3.4.8a (with all the changes already added to it). If anyone else needs it, you can download it from here:
phorum-3.4.8a_views_hack.zip
Post Edited (08-13-04 11:01)
regards
mt
Sorry, you do not have permission to post/reply in this forum.