You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 68 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Topics module doesn't display news [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
cadexpert
Nuke Cadet
Nuke Cadet


Joined: Aug 05, 2004
Posts: 3


PostPosted: Mon Nov 13, 2006 10:07 am Reply with quoteBack to top

Hello

I have installed phpnuke 7.8 and in my testing I created some topics and posted some news which appears OK in the fist page as the News module is set selected for the first page.

But when I clik on the topics in the main menu, the topics module shows nothing and give me a message that there is no articles.

I tried to see the Topics module code (I not an expert) and I but an echo message to check what sort of SQL message is sent to the mysql. I got the query printed and as shown:
SELECT t.topicid, t.topicimage, t.topictext, count(s.sid) AS stories, SUM(s.counter) AS reads FROM nuke_topics t LEFT JOIN nuke_stories s ON (s.topic = t.topicid) GROUP BY t.topicid, t.topicimage, t.topictext ORDER BY t.topictext
I copied the quesy and try to run it in mysqlAdmin and I got an error and as shown:

SQL-query :

SELECT t.topicid, t.topicimage, t.topictext, count( s.sid ) AS stories, SUM( s.counter ) AS reads
FROM nuke_topics
LEFT JOIN nuke_stories s ON ( s.topic = t.topicid )
GROUP BY t.topicid, t.topicimage, t.topictext
ORDER BY t.topictext
LIMIT 0 , 30

MySQL said:


You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads FROM nuke_topics LEFT JOIN nuke_stories s ON ( s.topic =

The original php code which generate this message inside the Topics module index.php:

$sql = "SELECT t.topicid, t.topicimage, t.topictext, count(s.sid) AS stories, SUM(s.counter) AS reads FROM ".$prefix."_topics t LEFT JOIN ".$prefix."_stories s ON (s.topic = t.topicid) GROUP BY t.topicid, t.topicimage, t.topictext ORDER BY t.topictext";
echo $sql;
$result = $db->sql_query($sql);
if ($db->sql_numrows($result) > 0) {
..
..

Please can any body help and tell me whats wrong. Help I am lost

Thanks alot

New & More Info:

1. I used an phpNuke 7.8 with arabic labg support.
2. I replaced the 7.8 topic module with an older one (may be 7.2) and It works just fine. Exclamation Exclamation Exclamation

I beileve now more at the problem is from the code that generate the query (May be Sad )
Find all posts by cadexpertView user's profileSend private messageVisit poster's website
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12383


PostPosted: Wed Nov 15, 2006 6:45 am Reply with quoteBack to top

Hmm what version of MySQL are you using? I believe it is dying on the reads part because reads is a reserved word

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
cadexpert
Nuke Cadet
Nuke Cadet


Joined: Aug 05, 2004
Posts: 3


PostPosted: Thu Nov 16, 2006 11:58 am Reply with quoteBack to top

Hei

MySQL version is 5.0.24a.
I took your not abour reads. I changed the SQL query above (i sed any name in stade of reads) and the quesry was successful.

So, is it a bug or reads haven reserved in SQL ver.5.

I checked phpnuke 8 Topics module and it uses the same programing lines and gives the same query.

Can you tell me where is the problem and wgy this module is working in your sit for example as tens of other sites (may be thousends) but not with me. is it SQL5. I will try to change the Topics module with another variable name in stade of reads and see but please can you help.

Thanks alot tou and all the others in Nukecops
Find all posts by cadexpertView user's profileSend private messageVisit poster's website
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12383


PostPosted: Thu Nov 16, 2006 6:19 pm Reply with quoteBack to top

Generally phpBB and phpNuke do not support MySQL 5. I would suggest using MySQL 4 right now

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
cadexpert
Nuke Cadet
Nuke Cadet


Joined: Aug 05, 2004
Posts: 3


PostPosted: Fri Nov 17, 2006 12:24 pm Reply with quoteBack to top

Hei
Thanks for the explanation.
I have changed the variable name in the Topics module (index.php file) from reads to reado (this variable appears in 3 places in the code) and every thing works well under mySQL 5 (tested with nuke 7.Cool
Thanks a lot for the tip about reads, it helped in fixing the module. If any one intrested, or have similar problem with Topics module, just leave a not or PM.
Find all posts by cadexpertView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.729 Seconds - 254 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::