Log in Register FAQ Memberlist Search Welcome to RCF - WHF Forum Index
alt : test.swf
Welcome to RCF - WHF
4fx3.gif 
calendar_open_closeCalendar 
forum views counter error
Post new topic   Reply to topic View previous topic :: View next topic
Goto page: Previous  1, 2
Welcome to RCF - WHF Forum Index -> Area 51 - phpBB & Easymod Tech Support Add To Bookmarks
Re: forum views counter error
PostPosted: 11/13/2006 11:41 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 5:06 PM
Location: St Pete, FL
peace.gif
I'm glad that worked.  So now what I need to do is compare the files that were modified and see if there is anything obvious that stands out.  I will try to do that after I get some sleep...

munky2
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: forum views counter error
PostPosted: 11/14/2006 1:37 PM Reply with quote
Crow
Jace
Crow
Posts 66
Word Cnt. 2,029
BDay May 15
Sign Taurus
Sex Sex:Male
Joined: Oct 28, 2006
Local time: 4:06 PM
netherlf_2fx.gif
Ow, ok. Thanks NR.


btw, I found out that all captcha.php files (not only of phpBB) aren't working anymore
Back to Top
View user's profile Find all posts by Jace Send private message  
Re: forum views counter error
PostPosted: 11/15/2006 12:31 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 5:06 PM
Location: St Pete, FL
peace.gif
Could you zip up the backups and processed folders, including their contents, from the forum views counter error MOD and make it available for me to download?  I would like to compare the before and after files to try to figure out what caused this problem...

What is captcha???

munky2
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: forum views counter error
PostPosted: 11/15/2006 11:06 AM Reply with quote
Crow
Jace
Crow
Posts 66
Word Cnt. 2,029
BDay May 15
Sign Taurus
Sex Sex:Male
Joined: Oct 28, 2006
Local time: 4:06 PM
netherlf_2fx.gif
well, that thing that makes you first type the letters seen in a image. That thing what you get when you rigister but also for a few guestbooks.
Back to Top
View user's profile Find all posts by Jace Send private message  
Re: forum views counter error
PostPosted: 11/15/2006 11:15 AM Reply with quote
Crow
Jace
Crow
Posts 66
Word Cnt. 2,029
BDay May 15
Sign Taurus
Sex Sex:Male
Joined: Oct 28, 2006
Local time: 4:06 PM
netherlf_2fx.gif
and thi9s is the link to the file

http://rapidshare.com/files/3473889/forum_views.zip
Back to Top
View user's profile Find all posts by Jace Send private message  
Re: forum views counter error
PostPosted: 11/16/2006 4:27 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 5:06 PM
Location: St Pete, FL
peace.gif
Ok, I see the error.  The MOD author made a mistake that is probably easy to overlook and make.  In this instance the mistake is not blatantly obvious like most errors are.  So let me attempt to explain what happened and hopefully I won't confuse you...

For SQL queries, the standard is to assign the SELECT queries to a result set variable named $result.  Every result set after a SELECT query needs to be freed to avoid memory leaks.  So you would normally see something like this after the result set is no longer needed:

Code:
$db->sql_freeresult($result);

This line of code frees up the memory so that the server OS can use it for something else...

Non SELECT queries such as UPDATE, DELETE, CREATE, and INSERT return a true or false value instead of a result set.  Since there is no need to free any resources for true or false values since no memory has been allocated to store them, then it is unnecessary to use the sql_freeresult function to free it.  In fact, if you attempt to free a non-set, you will see an error message similar to what you listed on the previous page in this topic.  That is the mistake that the MOD author made on this MOD...

So to fix the MOD script, do this:

OPEN
forum_views_counter_1.0.0.txt

FIND
Code:
#
#-----[ BEFORE, ADD ]------------------------------------------
#

// Start Forum Views Counter MOD
$sql = 'UPDATE ' . FORUMS_TABLE . "
   SET forum_views = forum_views + 1
   WHERE forum_id = $forum_id";

if ( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not update forum views count', '', __LINE__, __FILE__, $sql);
}

$db->sql_freeresult($result);
// End Forum Views Counter MOD

REPLACE WITH
Code:
#
#-----[ BEFORE, ADD ]------------------------------------------
#

// Start Forum Views Counter MOD
$sql = 'UPDATE ' . FORUMS_TABLE . "
   SET forum_views = forum_views + 1
   WHERE forum_id = $forum_id";

if ( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not update forum views count', '', __LINE__, __FILE__, $sql);
}
// End Forum Views Counter MOD

Save, upload, and try again using EM...

That was a hard error to find...

headbang
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: forum views counter error
PostPosted: 11/16/2006 1:04 PM Reply with quote
Crow
Jace
Crow
Posts 66
Word Cnt. 2,029
BDay May 15
Sign Taurus
Sex Sex:Male
Joined: Oct 28, 2006
Local time: 4:06 PM
netherlf_2fx.gif
woohooo. It worked.

Thanks for going true all that work. I'm sure more people have the same prob so maybe you should post this edited version the the mod autor or to phpbb.com


btw, do you make any mods yourself? since you so handy with php
Back to Top
View user's profile Find all posts by Jace Send private message  
Re: forum views counter error
PostPosted: 11/17/2006 2:40 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 5:06 PM
Location: St Pete, FL
peace.gif
I don't know where the MOD topic is located, but you are free to post the correction if you can find it.  I would be surprised if the MOD author hasn't figured it out by now.  This would affect everyone who installs his MOD...

I have written a few small MODs and co-authored a couple others.  I don't understand php thoroughly enough to write a large MOD yet though...

headbang
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: forum views counter error
PostPosted: 11/17/2006 10:30 AM Reply with quote
Crow
Jace
Crow
Posts 66
Word Cnt. 2,029
BDay May 15
Sign Taurus
Sex Sex:Male
Joined: Oct 28, 2006
Local time: 4:06 PM
netherlf_2fx.gif
Ok.


I still got a little question. Sometimes there are errors in a mod. Do those errors also apply when doing a manual install or is Easymod just not capible of doing the requested moding.
Back to Top
View user's profile Find all posts by Jace Send private message  
Re: forum views counter error
PostPosted: 11/17/2006 10:38 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 5:06 PM
Location: St Pete, FL
peace.gif
The errors that you see when installing a MOD with EM are caused when the FIND doesn't match EXACTLY with code in your phpBB files.  What could make something not match is an extra or missing space or character in the line of code in the phpBB file.  So if you searched for the same code in the FIND that EM is using then you wouldn't find the code either.  That's why it is important to minimize the FIND statements so that there is much less chance that the code won't match...

munky2
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
 Post new topic  Reply to topic
Information
Welcome to RCF - WHF Forum Index -> Area 51 - phpBB & Easymod Tech Support

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
You cannot attach files in this forum
You cannot download files in this forum
All times are GMT - 5 Hours
Goto page: Previous  1, 2
Page 2 of 2


Add To Bookmarks

 
  
  


  Google

Powered by phpBB © 2001, 2005 phpBB Group

Page generation time: 0.0875s (PHP: 62% - SQL: 38%) - SQL queries: 57 - GZIP disabled - Debug on