Page 2 of 2

no chance to get "most read articles" work - HELP

Posted: Thu 17. Feb 2005, 12:21
by lady_witchcraft
2nd post 'cause i can't get the most read articles count working - only thing that has changed - no more error messages occure with putting the code in the frontend_render folder as brans suggested :lol: !

main prob is that the code doesn`t create any db records in the new table (created following an older thread: CREATE TABLE `phpwcms_article_read_count` (
`date_read` datetime NOT NULL default '0000-00-00 00:00:00',
`article_id` int(11) NOT NULL default '0',
`cat_id` int(11) NOT NULL default '0',
PRIMARY KEY (`date_read`)
) TYPE=MyISAM; )

And why the hell are no written infos in the table :evil: ??? any suggestions? please guys help me!!! thx in advance!

it doesnt work

Posted: Sat 19. Mar 2005, 22:33
by snezko
sorry, I did exactly what did you write here. I have a 1.2 dev version. And this tag after implementation doesnt work

Posted: Mon 21. Mar 2005, 08:08
by marcus@localhorst
hi i found out the tableprepend variable doesn't work

Code: Select all

FROM ".DB_PREPEND."article_read_count 
i just remove the DB_PREPEND and write my real tablename in the sql and it work.

Code: Select all

FROM phpwcms_article_read_count 
strange

still no records in DB

Posted: Mon 21. Mar 2005, 10:15
by lady_witchcraft
hy marcus,

thx for your suggestion, tried it but still got the same problem, no records are listet in the table :evil: tried a lot of things, but i really got no idea why the most_read function doesn`t works and the code doesn`t creats any records!? :?

greets from vienna

Posted: Mon 21. Mar 2005, 12:13
by marcus@localhorst
look at this thread:
http://phpwcms.de/forum/viewtopic.php?t=4816

Code: Select all

//------------------------------------------------------------------------------			
// THIS IS FOR THE MOST_READ {RT}
// http://phpwcms.de/forum/viewtopic.php?t=4816
// http://dev-brenner-b-e/index.php/topic,42.0.html
//------------------------------------------------------------------------------	
          if ($count_str_sql=="") {
          $count_str_sql ="insert into phpwcms_article_read_count values(now() , " .$content["article_id"] . "," . $content["cat_id"]  . ")"; 
          $count_sql = mysql_query($count_str_sql,$db); 
          if (!$count_sql) echo "sql error : " . $count_sql . " - " . $count_str_sql. "\n<br>"; 
          echo mysql_error();
          }
//------------------------------------------------------------------------------
put this line in the code:
echo mysql_error();

and it will show what's wrong with sql.
hope that helps

Posted: Thu 24. Mar 2005, 04:27
by ndtoan13
I try

Code: Select all

"insert into ".DB_PREPEND."phpwcms_article_read_count values(now() , " .$content["article_id"] . "," . $content["cat_id"]  . ")"; 
but it does not save data into databse??? Do anyone get it?

Posted: Thu 24. Mar 2005, 04:36
by ndtoan13
Do any one try to put some data into database by hand? I do that but the content does not display??

Posted: Tue 16. May 2006, 18:27
by velo
I like this mod. But now im wondering, is it possible to just show the most read articles from a certain category?

velo

Posted: Thu 16. Nov 2006, 11:42
by liro
It is working, but indeed is it possible to exclude certain categories?
If I place {most_read} I get certain menu items as most read, which is obvious. But you do not want to see that "welcome" is the most read page of your site.

Rolph