Home
>
Outdated forums
>
Phorum 3 forums (READ ONLY)
>
Finished Mods and Plug-ins (READ ONLY)
>
Topic
>
Page 4
Views Hack v2 Finished, Tested, and working
Posted by Vulpes
Re: As I put the views to list.php, problems began.. April 21, 2002 03:30PM |
im getting this error after following your instructions:
Unknown column 'userid' in 'field list'
Insert Into bbt (id, author, userid, email, datestamp, subject, host, thread, parent, email_reply, approved, msgid) values ('1', 'Peter', '2', 'staff@aussiesexposed.com', '2002-04-21 14:17:36', 'another Aussie Celeb group', 'adlax1-135.dialup.optusnet.com.au', '1', '0', '', 'Y', '')Unknown column 'modifystamp' in 'field list'
UPDATE bbt SET modifystamp = 1019416656 WHERE thread = 1
Warning: Cannot add header information - headers already sent by (output started at /home/www/aussieexposed/forums/include/post_functions.php:382) in /home/www/aussieexposed/forums/post.php on line 198
Warning: Cannot add header information - headers already sent by (output started at /home/www/aussieexposed/forums/include/post_functions.php:382) in /home/www/aussieexposed/forums/post.php on line 264
can anyone help me please?
Unknown column 'userid' in 'field list'
Insert Into bbt (id, author, userid, email, datestamp, subject, host, thread, parent, email_reply, approved, msgid) values ('1', 'Peter', '2', 'staff@aussiesexposed.com', '2002-04-21 14:17:36', 'another Aussie Celeb group', 'adlax1-135.dialup.optusnet.com.au', '1', '0', '', 'Y', '')Unknown column 'modifystamp' in 'field list'
UPDATE bbt SET modifystamp = 1019416656 WHERE thread = 1
Warning: Cannot add header information - headers already sent by (output started at /home/www/aussieexposed/forums/include/post_functions.php:382) in /home/www/aussieexposed/forums/post.php on line 198
Warning: Cannot add header information - headers already sent by (output started at /home/www/aussieexposed/forums/include/post_functions.php:382) in /home/www/aussieexposed/forums/post.php on line 264
can anyone help me please?
3.3.2.a April 25, 2002 06:05PM |
Registered: 23 years ago Posts: 2 |
I cant get it to work in 3.3.2a I think its to do with the following modification
3. Modify list.php (enable views fetching from db):
replace (around line 176):
if($$phcollapse==0){
$sSQL = "Select id,parent,thread,subject,author,datestamp from $ForumTableName where approved='Y' AND thread<=$max and thread>=$min order by thread desc, id asc";
}
else{
$sSQL = "Select id,thread,subject,author,datestamp from $ForumTableName where approved='Y' AND thread = id AND thread<=$max AND thread>=$min order by thread desc";
}
with:
if($$phcollapse==0){
$sSQL = "Select id,parent,thread,subject,author,datestamp,views from $ForumTableName where approved='Y' AND thread<=$max and thread>=$min order by thread desc, id asc";
}
else{
$sSQL = "Select id,thread,subject,author,datestamp,views from $ForumTableName where approved='Y' AND thread = id AND thread<=$max AND thread>=$min order by thread desc";
}
But i have
if($$phcollapse==0){
$SQL = "Select id,parent,thread,subject,author,datestamp,userid from $ForumTableName WHERE approved='Y' $myflag and thread IN (".$threadstring.") order by modifystamp desc, id asc";
} else {
$SQL = "Select id,0 as parent,thread,subject,author,datestamp,userid from $ForumTableName WHERE approved='Y' AND parent = 0 $myflag and thread IN (".$threadstring.") order by modifystamp desc";
}
and making the above changes destroys it
any one got it working on 3.3.2a can send their source
3. Modify list.php (enable views fetching from db):
replace (around line 176):
if($$phcollapse==0){
$sSQL = "Select id,parent,thread,subject,author,datestamp from $ForumTableName where approved='Y' AND thread<=$max and thread>=$min order by thread desc, id asc";
}
else{
$sSQL = "Select id,thread,subject,author,datestamp from $ForumTableName where approved='Y' AND thread = id AND thread<=$max AND thread>=$min order by thread desc";
}
with:
if($$phcollapse==0){
$sSQL = "Select id,parent,thread,subject,author,datestamp,views from $ForumTableName where approved='Y' AND thread<=$max and thread>=$min order by thread desc, id asc";
}
else{
$sSQL = "Select id,thread,subject,author,datestamp,views from $ForumTableName where approved='Y' AND thread = id AND thread<=$max AND thread>=$min order by thread desc";
}
But i have
if($$phcollapse==0){
$SQL = "Select id,parent,thread,subject,author,datestamp,userid from $ForumTableName WHERE approved='Y' $myflag and thread IN (".$threadstring.") order by modifystamp desc, id asc";
} else {
$SQL = "Select id,0 as parent,thread,subject,author,datestamp,userid from $ForumTableName WHERE approved='Y' AND parent = 0 $myflag and thread IN (".$threadstring.") order by modifystamp desc";
}
and making the above changes destroys it
any one got it working on 3.3.2a can send their source
Re: 3.3.2.a May 18, 2002 07:16AM |
Registered: 22 years ago Posts: 3 |
Re: Views Hack v2 Finished, Tested, and working May 27, 2002 04:03PM |
Joe
Re: Views Hack v2 Finished, Tested, and working May 31, 2002 12:28AM |
I tried adding a hack to version 3.3.2
this is what I get:
Unknown column 'userid' in 'field list'
Insert Into test (id, author, userid, email, datestamp, subject, host, thread, parent, email_reply, approved, msgid) values ('1', 'Test', '0', '', '2002-05-30 23:26:10', 'test', 'my_ip_here', '1', '0', '', 'Y', '<5cc3c7a87fc36be25f5bb4109c378c21.>')Unknown column 'modifystamp' in 'field list'
UPDATE test SET modifystamp = 1022819170 WHERE thread = 1
Warning: Cannot add header information - headers already sent by (output started at /home/sites/site162/web/forum/include/post_functions.php:382) in /home/sites/site162/web/forum/post.php on line 198
Warning: Cannot add header information - headers already sent by (output started at /home/sites/site162/web/forum/include/post_functions.php:382) in /home/sites/site162/web/forum/post.php on line 267
this is what I get:
Unknown column 'userid' in 'field list'
Insert Into test (id, author, userid, email, datestamp, subject, host, thread, parent, email_reply, approved, msgid) values ('1', 'Test', '0', '', '2002-05-30 23:26:10', 'test', 'my_ip_here', '1', '0', '', 'Y', '<5cc3c7a87fc36be25f5bb4109c378c21.>')Unknown column 'modifystamp' in 'field list'
UPDATE test SET modifystamp = 1022819170 WHERE thread = 1
Warning: Cannot add header information - headers already sent by (output started at /home/sites/site162/web/forum/include/post_functions.php:382) in /home/sites/site162/web/forum/post.php on line 198
Warning: Cannot add header information - headers already sent by (output started at /home/sites/site162/web/forum/include/post_functions.php:382) in /home/sites/site162/web/forum/post.php on line 267
Re: Views Hack v2 Finished, Tested, and working May 31, 2002 12:52AM |
Joe
Re: Views Hack v2 Finished, Tested, and working June 02, 2002 08:16PM |
Re: Views Hack v2 Finished, Tested, and working August 25, 2002 10:37AM |
Registered: 22 years ago Posts: 25 |
Re: Views Hack v2 Finished, Tested, and working September 01, 2002 11:59PM |
Registered: 23 years ago Posts: 11 |
Re: Views Hack v2 Finished, Tested, and working September 05, 2002 12:16AM |
Registered: 23 years ago Posts: 11 |
Re: Views Hack v2 Finished, Tested, and working September 05, 2002 12:20AM |
Registered: 23 years ago Posts: 11 |
why I don't see the attachment?
Try againa and post it here.
---------------------
#######################################################
# #
# VIEWS HACK 2.0a #
# MySQL only, but easilly adapted #
# #
########################################################
!!!!!!BEFORE YOU DO ANYTHING, BACKUP YOUR ENTIRE PHORUM DIR USING ZIP OR TAR!!!!!!!!
It was tested and worked using Phorum 3.4_dev with PHP 4.2.2 and MySQL 3.23.32
All line numbers for v3.4. In newer or older Phorum Versions Lines will be different...
1. Modify read.php (this will increment the view count everytime someone fetches the page):
before this line (Line 176):
$msg_body = new query($DB, $sSQL);
insert:
// Views Hack Start
$vSQL = "SELECT * FROM $ForumTableName WHERE id=".$id;
$views = mysql_query($vSQL);
$row = mysql_fetch_array($views);
$vSQL = "UPDATE $ForumTableName SET views=" . ($row["views"] + 1) . " WHERE id=$id";
mysql_query($vSQL);
// Views Hack End
2. Modify db/mysql.php (this will make sure all new forums get the extra views column):
replace line (167)
function create_table(&$DB, $table, $table_name){
global $q;
switch($table){
case "main":
$sSQL="CREATE TABLE $table_name (
id int unsigned DEFAULT '0' NOT NULL,
datestamp datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
thread int unsigned DEFAULT '0' NOT NULL,
parent int unsigned DEFAULT '0' NOT NULL,
author char(37) DEFAULT '' NOT NULL,
subject char(255) DEFAULT '' NOT NULL,
email char(200) DEFAULT '' NOT NULL,
host char(50) DEFAULT '' NOT NULL,
email_reply char(1) NOT NULL DEFAULT 'N',
approved char(1) NOT NULL DEFAULT 'N',
msgid char(100) DEFAULT '' NOT NULL,
modifystamp int unsigned DEFAULT '0' NOT NULL,
userid int unsigned DEFAULT 0 NOT NULL,
PRIMARY KEY (id),
KEY author (author),
KEY userid (userid),
KEY datestamp (datestamp),
KEY subject (subject),
KEY thread (thread),
KEY parent (parent),
KEY approved (approved),
KEY msgid (msgid),
KEY modifystamp (modifystamp)
)";
with this :
function create_table(&$DB, $table, $table_name){
global $q;
switch($table){
case "main":
$sSQL="CREATE TABLE $table_name (
id int unsigned DEFAULT '0' NOT NULL,
datestamp datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
thread int unsigned DEFAULT '0' NOT NULL,
parent int unsigned DEFAULT '0' NOT NULL,
author char(37) DEFAULT '' NOT NULL,
subject char(255) DEFAULT '' NOT NULL,
email char(200) DEFAULT '' NOT NULL,
host char(50) DEFAULT '' NOT NULL,
email_reply char(1) NOT NULL DEFAULT 'N',
approved char(1) NOT NULL DEFAULT 'N',
msgid char(100) DEFAULT '' NOT NULL,
modifystamp int unsigned DEFAULT '0' NOT NULL,
userid int unsigned DEFAULT 0 NOT NULL,
views INT(7) DEFAULT '0',
PRIMARY KEY (id),
KEY author (author),
KEY userid (userid),
KEY datestamp (datestamp),
KEY subject (subject),
KEY thread (thread),
KEY parent (parent),
KEY approved (approved),
KEY msgid (msgid),
KEY modifystamp (modifystamp)
)";
which is just adding a line
views INT(7) DEFAULT '0',
3. Modify list.php (enable views fetching from db):
replace (line 270):
if($$phcollapse==0){
$SQL = "Select id,parent,thread,subject,author,datestamp,userid from $ForumTableName where approved='Y' AND thread<=$max and thread>=$min order by thread desc, id asc";
}
else{
$SQL = "Select id,thread,subject,author,datestamp,userid from $ForumTableName where approved='Y' AND thread = id AND thread<=$max AND thread>=$min order by thread desc";
}
with:
if($$phcollapse==0){
$SQL = "Select id,parent,thread,subject,author,datestamp,userid,views from $ForumTableName where approved='Y' AND thread<=$max and thread>=$min order by thread desc, id asc";
}
else{
$SQL = "Select id,thread,subject,author,datestamp,userid,views from $ForumTableName where approved='Y' AND thread = id AND thread<=$max AND thread>=$min order by thread desc";
}
4. Modify include/multi-threads.php (to display the actual views):
after this line (should be at the very beginning of the file):
$thread_total="";
insert:
$views = $topic["views"];
You can now use echo($views); to display the number of views, you can choose where you want to insert the views count.
To use it do this:
Find in the very buttom:
<table class="PhorumListTable" width="<?php echo $ForumTableWidth;?>" cellspacing="0" cellpadding="0" border="0" align="center">
<tr>
<td class="PhorumListHeader"<?php echo bgcolor($ForumTableHeaderColor);?>><font color="<?php echo $ForumTableHeaderFontColor; ?>"> <?php echo $lTopics;?><img src="images/trans.gif" border="0" width=1 height=24 align="absmiddle"></font></td>
<td class="PhorumListHeader"<?php echo bgcolor($ForumTableHeaderColor);?> nowrap width=150><font color="<?php echo $ForumTableHeaderFontColor; ?>"><?php echo $lAuthor;?> </font></td>
<td class="PhorumListHeader"<?php echo bgcolor($ForumTableHeaderColor);?> nowrap width=150><font color="<?php echo $ForumTableHeaderFontColor; ?>"><?php echo $lDate;?></font></td>
</tr>
This is top Header where it says Subject, Author, Date.
to add Views colum add:
<TD class="PhorumListHeader" <?PHP echo bgcolor($ForumTableHeaderColor);?> NOWRAP WIDTH=70><center><FONT COLOR="<?php echo $ForumTableHeaderFontColor; ?>">Views </FONT></center></TD>
You can chage it however you want
Now to add numbers find it somewhere in the middle:
<tr valign=middle>
<td class="PhorumListRow" <?php echo bgcolor($bgcolor);?>><?php echo $subject;?></td>
<td class="PhorumListRow" <?php echo bgcolor($bgcolor);?> nowrap><font color="<?php echo $font_color;?>"><?php echo $author;?></font></td>
<td class="PhorumListRow" <?php echo bgcolor($bgcolor);?> nowrap><font color="<?php echo $font_color;?>"><?php echo $datestamp;?> </font></td>
</tr>
it's actual variables
add viewes colum:
<TD class="PhorumListRow" <?PHP echo bgcolor($bgcolor);?> nowrap><FONT COLOR="<?php echo $font_color;?>"> <?php echo $views;?></FONT></TD>
You can chage it however you want
5. Modify include/threads.php:
after this line (should be around line 58 (you get this right)):
$t_author=chop($message["author"]);
insert:
$views = $message["views"];
You can now use echo($views); to display the number of views, you can choose where you want to insert the views count.
To use it do this:
Find (should be around the bottom)
echo "</td>\n";
echo ' <td class="PhorumListRow" width="150" '.$color.' nowrap="nowrap"><FONT color="'.$fcolor.'">'.$t_author.' '</font></td>'."\n";
if( $$phcollapse != 0 && empty($read) ){
$t_count=$trec["tcount"]-1;
if(!empty($message)) $trec=$threads[$message["thread"]];
echo ' <td class="PhorumListRow" align="center" width="80" '.$color.' nowrap="nowrap"><FONT color="'.$fcolor.'" size=-1>'.$t_count." </font></td>\n";
echo ' <td class="PhorumListRow" width="120" '.$color.' nowrap="nowrap"><FONT color="'.$fcolor.'" size=-1>'.$t_latest." </font></td>\n";
}
it's actual variables
add viewes colum :
echo "</td>\n";
echo ' <td class="PhorumListRow" width="150" '.$color.' nowrap="nowrap"><FONT color="'.$fcolor.'">'.$t_author.' '</font></td>'."\n";
echo ' <td class="PhorumListRow" width="70" '.$color.' nowrap><FONT color="'.$fcolor.'">'.$views.' </font></td>'."\n";
if( $$phcollapse != 0 && empty($read) ){
$t_count=$trec["tcount"]-1;
if(!empty($message)) $trec=$threads[$message["thread"]];
echo ' <td class="PhorumListRow" align="center" width="80" '.$color.' nowrap="nowrap"><FONT color="'.$fcolor.'" size=-1>'.$t_count." </font></td>\n";
echo ' <td class="PhorumListRow" width="120" '.$color.' nowrap="nowrap"><FONT color="'.$fcolor.'" size=-1>'.$t_latest." </font></td>\n";
}
You can chage it however you want
Done with hack part...
Now go to MySQL, add a new colume to the data base
ALTER TABLE <forumname> ADD views INT(7) DEFAULT '0';
Do this with every forum.
My hosting has Phorum 3.4 current dev with MySQL 3.23.32 and php4.2.2
Good Luck
---------------------------------------------------------------------------------------------
Try againa and post it here.
---------------------
#######################################################
# #
# VIEWS HACK 2.0a #
# MySQL only, but easilly adapted #
# #
########################################################
!!!!!!BEFORE YOU DO ANYTHING, BACKUP YOUR ENTIRE PHORUM DIR USING ZIP OR TAR!!!!!!!!
It was tested and worked using Phorum 3.4_dev with PHP 4.2.2 and MySQL 3.23.32
All line numbers for v3.4. In newer or older Phorum Versions Lines will be different...
1. Modify read.php (this will increment the view count everytime someone fetches the page):
before this line (Line 176):
$msg_body = new query($DB, $sSQL);
insert:
// Views Hack Start
$vSQL = "SELECT * FROM $ForumTableName WHERE id=".$id;
$views = mysql_query($vSQL);
$row = mysql_fetch_array($views);
$vSQL = "UPDATE $ForumTableName SET views=" . ($row["views"] + 1) . " WHERE id=$id";
mysql_query($vSQL);
// Views Hack End
2. Modify db/mysql.php (this will make sure all new forums get the extra views column):
replace line (167)
function create_table(&$DB, $table, $table_name){
global $q;
switch($table){
case "main":
$sSQL="CREATE TABLE $table_name (
id int unsigned DEFAULT '0' NOT NULL,
datestamp datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
thread int unsigned DEFAULT '0' NOT NULL,
parent int unsigned DEFAULT '0' NOT NULL,
author char(37) DEFAULT '' NOT NULL,
subject char(255) DEFAULT '' NOT NULL,
email char(200) DEFAULT '' NOT NULL,
host char(50) DEFAULT '' NOT NULL,
email_reply char(1) NOT NULL DEFAULT 'N',
approved char(1) NOT NULL DEFAULT 'N',
msgid char(100) DEFAULT '' NOT NULL,
modifystamp int unsigned DEFAULT '0' NOT NULL,
userid int unsigned DEFAULT 0 NOT NULL,
PRIMARY KEY (id),
KEY author (author),
KEY userid (userid),
KEY datestamp (datestamp),
KEY subject (subject),
KEY thread (thread),
KEY parent (parent),
KEY approved (approved),
KEY msgid (msgid),
KEY modifystamp (modifystamp)
)";
with this :
function create_table(&$DB, $table, $table_name){
global $q;
switch($table){
case "main":
$sSQL="CREATE TABLE $table_name (
id int unsigned DEFAULT '0' NOT NULL,
datestamp datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
thread int unsigned DEFAULT '0' NOT NULL,
parent int unsigned DEFAULT '0' NOT NULL,
author char(37) DEFAULT '' NOT NULL,
subject char(255) DEFAULT '' NOT NULL,
email char(200) DEFAULT '' NOT NULL,
host char(50) DEFAULT '' NOT NULL,
email_reply char(1) NOT NULL DEFAULT 'N',
approved char(1) NOT NULL DEFAULT 'N',
msgid char(100) DEFAULT '' NOT NULL,
modifystamp int unsigned DEFAULT '0' NOT NULL,
userid int unsigned DEFAULT 0 NOT NULL,
views INT(7) DEFAULT '0',
PRIMARY KEY (id),
KEY author (author),
KEY userid (userid),
KEY datestamp (datestamp),
KEY subject (subject),
KEY thread (thread),
KEY parent (parent),
KEY approved (approved),
KEY msgid (msgid),
KEY modifystamp (modifystamp)
)";
which is just adding a line
views INT(7) DEFAULT '0',
3. Modify list.php (enable views fetching from db):
replace (line 270):
if($$phcollapse==0){
$SQL = "Select id,parent,thread,subject,author,datestamp,userid from $ForumTableName where approved='Y' AND thread<=$max and thread>=$min order by thread desc, id asc";
}
else{
$SQL = "Select id,thread,subject,author,datestamp,userid from $ForumTableName where approved='Y' AND thread = id AND thread<=$max AND thread>=$min order by thread desc";
}
with:
if($$phcollapse==0){
$SQL = "Select id,parent,thread,subject,author,datestamp,userid,views from $ForumTableName where approved='Y' AND thread<=$max and thread>=$min order by thread desc, id asc";
}
else{
$SQL = "Select id,thread,subject,author,datestamp,userid,views from $ForumTableName where approved='Y' AND thread = id AND thread<=$max AND thread>=$min order by thread desc";
}
4. Modify include/multi-threads.php (to display the actual views):
after this line (should be at the very beginning of the file):
$thread_total="";
insert:
$views = $topic["views"];
You can now use echo($views); to display the number of views, you can choose where you want to insert the views count.
To use it do this:
Find in the very buttom:
<table class="PhorumListTable" width="<?php echo $ForumTableWidth;?>" cellspacing="0" cellpadding="0" border="0" align="center">
<tr>
<td class="PhorumListHeader"<?php echo bgcolor($ForumTableHeaderColor);?>><font color="<?php echo $ForumTableHeaderFontColor; ?>"> <?php echo $lTopics;?><img src="images/trans.gif" border="0" width=1 height=24 align="absmiddle"></font></td>
<td class="PhorumListHeader"<?php echo bgcolor($ForumTableHeaderColor);?> nowrap width=150><font color="<?php echo $ForumTableHeaderFontColor; ?>"><?php echo $lAuthor;?> </font></td>
<td class="PhorumListHeader"<?php echo bgcolor($ForumTableHeaderColor);?> nowrap width=150><font color="<?php echo $ForumTableHeaderFontColor; ?>"><?php echo $lDate;?></font></td>
</tr>
This is top Header where it says Subject, Author, Date.
to add Views colum add:
<TD class="PhorumListHeader" <?PHP echo bgcolor($ForumTableHeaderColor);?> NOWRAP WIDTH=70><center><FONT COLOR="<?php echo $ForumTableHeaderFontColor; ?>">Views </FONT></center></TD>
You can chage it however you want
Now to add numbers find it somewhere in the middle:
<tr valign=middle>
<td class="PhorumListRow" <?php echo bgcolor($bgcolor);?>><?php echo $subject;?></td>
<td class="PhorumListRow" <?php echo bgcolor($bgcolor);?> nowrap><font color="<?php echo $font_color;?>"><?php echo $author;?></font></td>
<td class="PhorumListRow" <?php echo bgcolor($bgcolor);?> nowrap><font color="<?php echo $font_color;?>"><?php echo $datestamp;?> </font></td>
</tr>
it's actual variables
add viewes colum:
<TD class="PhorumListRow" <?PHP echo bgcolor($bgcolor);?> nowrap><FONT COLOR="<?php echo $font_color;?>"> <?php echo $views;?></FONT></TD>
You can chage it however you want
5. Modify include/threads.php:
after this line (should be around line 58 (you get this right)):
$t_author=chop($message["author"]);
insert:
$views = $message["views"];
You can now use echo($views); to display the number of views, you can choose where you want to insert the views count.
To use it do this:
Find (should be around the bottom)
echo "</td>\n";
echo ' <td class="PhorumListRow" width="150" '.$color.' nowrap="nowrap"><FONT color="'.$fcolor.'">'.$t_author.' '</font></td>'."\n";
if( $$phcollapse != 0 && empty($read) ){
$t_count=$trec["tcount"]-1;
if(!empty($message)) $trec=$threads[$message["thread"]];
echo ' <td class="PhorumListRow" align="center" width="80" '.$color.' nowrap="nowrap"><FONT color="'.$fcolor.'" size=-1>'.$t_count." </font></td>\n";
echo ' <td class="PhorumListRow" width="120" '.$color.' nowrap="nowrap"><FONT color="'.$fcolor.'" size=-1>'.$t_latest." </font></td>\n";
}
it's actual variables
add viewes colum :
echo "</td>\n";
echo ' <td class="PhorumListRow" width="150" '.$color.' nowrap="nowrap"><FONT color="'.$fcolor.'">'.$t_author.' '</font></td>'."\n";
echo ' <td class="PhorumListRow" width="70" '.$color.' nowrap><FONT color="'.$fcolor.'">'.$views.' </font></td>'."\n";
if( $$phcollapse != 0 && empty($read) ){
$t_count=$trec["tcount"]-1;
if(!empty($message)) $trec=$threads[$message["thread"]];
echo ' <td class="PhorumListRow" align="center" width="80" '.$color.' nowrap="nowrap"><FONT color="'.$fcolor.'" size=-1>'.$t_count." </font></td>\n";
echo ' <td class="PhorumListRow" width="120" '.$color.' nowrap="nowrap"><FONT color="'.$fcolor.'" size=-1>'.$t_latest." </font></td>\n";
}
You can chage it however you want
Done with hack part...
Now go to MySQL, add a new colume to the data base
ALTER TABLE <forumname> ADD views INT(7) DEFAULT '0';
Do this with every forum.
My hosting has Phorum 3.4 current dev with MySQL 3.23.32 and php4.2.2
Good Luck
---------------------------------------------------------------------------------------------
Re: Views Hack v2 Finished, Tested, and working September 05, 2002 12:40AM |
Registered: 23 years ago Posts: 11 |
Re: Views Hack v2 Finished, Tested, and working September 27, 2002 06:23AM |
Registered: 22 years ago Posts: 3 |
Re: Views Hack v2 Finished, Tested, and working October 03, 2002 04:06AM |
Registered: 22 years ago Posts: 3 |
I´m trying to use it on dev3.4 October 15, 2002 10:28AM |
Registered: 23 years ago Posts: 11 |
Hi, i´ve instaled this hack on 3.4 Dev...
Well i´m not an expert in php (i´m a rookie yet :-)), and what happened is that on the Forum List (list.php) i get only the Views tittle, and i get no views numbers...
When i go to a message, (read.php) i get everything ok in the treath...
I dont know whats the problem... i did everything like Vulpes said, probably is because i´m using 3.4 dev ... But its very strange that works on read.php and dont works on list.php, when both files include threath.php and multi-threath.php...
Does anybody can help me with this... :-)))
I´m also thinking in create some sort of ranking of the most viewed posts of the day/week/month/all times....
best regards, and thanks in advance for this great team !!!
Same problem October 17, 2002 10:57AM |
Registered: 23 years ago Posts: 11 |
can you help me with 3,4dev ? October 17, 2002 11:37AM |
Registered: 23 years ago Posts: 11 |
HEHEH... ok i got it... October 18, 2002 08:43AM |
Registered: 23 years ago Posts: 11 |
A little update request ... :-) October 18, 2002 08:20PM |
Registered: 23 years ago Posts: 11 |
I´ve implemented the hack.... thats really cool .... :-)
Know i was thinking in doing a little update, to sort the Forum list.php from the most viewed postes... (no problem with that)....
But how can i sort it from the most viewed messages of the DAY ?
I dont know much about php... if anybody could teach me how to make it... i´d be greatful...i got this on list.php :
if($$phcollapse==0){
$SQL = "Select id,parent,thread,subject,author,datestamp,userid,views from $ForumTableName where approved='Y' AND thread<=$max and thread>=$min order by views desc, id asc";
}
else{
$SQL = "Select id,thread,subject,author,datestamp,userid,views from $ForumTableName where approved='Y' AND thread = id AND thread<=$max AND thread>=$min order by views desc";
}
How to sort by views, and with a time limite ?
best regards
Re: Views Hack v2 Finished, Tested, and working October 23, 2002 02:25PM |
Registered: 22 years ago Posts: 6 |
Sorry, you do not have permission to post/reply in this forum.