MOST_READ : front end code to add

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
User avatar
lady_witchcraft
Posts: 94
Joined: Sun 14. Nov 2004, 19:19
Location: Austria
Contact:

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

Post 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's not bad luck, it's a bug ...
snezko
Posts: 21
Joined: Fri 11. Mar 2005, 18:33
Location: Wien
Contact:

it doesnt work

Post 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
many thanks Snezko
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post 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
User avatar
lady_witchcraft
Posts: 94
Joined: Sun 14. Nov 2004, 19:19
Location: Austria
Contact:

still no records in DB

Post 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
... it's not bad luck, it's a bug ...
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post 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
ndtoan13
Posts: 29
Joined: Wed 16. Mar 2005, 05:11
Contact:

Post 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?
ndtoan13
Posts: 29
Joined: Wed 16. Mar 2005, 05:11
Contact:

Post by ndtoan13 »

Do any one try to put some data into database by hand? I do that but the content does not display??
velo
Posts: 38
Joined: Sun 29. May 2005, 14:48

Post 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
liro
Posts: 41
Joined: Thu 16. Jun 2005, 08:29
Location: Netherlands
Contact:

Post 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
Post Reply