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, 138 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Fix: Topics module of V7.9.0.3.2e, sql syntax error [ ]
 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
xairho
Nuke Soldier
Nuke Soldier


Joined: Jan 17, 2006
Posts: 12


PostPosted: Thu Aug 17, 2006 7:48 am Reply with quoteBack to top

I found a bug in the Topics module with MySQL5. It didnt show the topics.
Reason was the mysql5 keyword "reads", used as varname in the query.
By that, the query failed and returned 0 rows, so no topics were shown.


Fix:
(line numbers are from PHPNuke7.9.0.3.2e)

---
OPEN FILE: modules/Topics/index.php

FIND: (line 28)
Code:
$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";


REPLACE WITH:
Code:
$sql = "SELECT t.topicid, t.topicimage, t.topictext, count(s.sid) AS stories, SUM(s.counter) AS thereads 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";


FIND: (line 55)
Code:
$output .= "<big><strong>&middot;</strong></big> <b>"._TOTREADS.":</b> ".(isset($row['reads']) ? $row['reads'] : 0)."</font>";


REPLACE WITH:
Code:
$output .= "<big><strong>&middot;</strong></big> <b>"._TOTREADS.":</b> ".(isset($row['thereads']) ? $row['thereads'] : 0)."</font>";


SAVE FILE: modules/Topics/index.php
DONE
---

_________________
There are 10 kinds of people. Those who understand binary values, and those who dont
---
Sorry for my weird english. Im german, and Im blonde Very Happy
Find all posts by xairhoView user's profileSend private message
MarkusHolst
Nuke Cadet
Nuke Cadet


Joined: Dec 09, 2008
Posts: 1


PostPosted: Tue Dec 09, 2008 12:00 pm Reply with quoteBack to top

Maybe it is a bit to late to answer a 2 years old message, but I gice it a chance. Your bux fix did help me with my php 8.0, but there is still some problems with the topics module.

When you click on the topic icon, you are supposed to come to a site with just this topic. However, you come to the news site, with all topics in same order as on first side.

If you clikc the topic icon in news module, you come to an empty site with just a search box.

I think this is a bug on news/index.php. It doesnät take the link OK. I i use the link <a....&amp;topic=$topicid>, I come to the news side with all topics on. If I use the link <a ........&amp;new_topic=$topicid> I comer to the empty side with search box.

Do you have any clue what is wrong. I think the new_topic link is more correct then the other, but the site can not find the topic.

I hope you will answer this.

regards,

Markus Holst
Sweden
Find all posts by MarkusHolstView user's profileSend private message
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 - TUTTISU E-COMMERCE http://www.tuttisu.it
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.587 Seconds - 81 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::