1 (edited by GeoffG 2007-04-25 10:52)

Topic: ERROR: Cannot Fetch Post Info

Ok, I just had the reputation mod installed worked 100% then I decided to add the image awards mod .... and I notice the 2 mods conflict a bit .. but I went through it anyways (they edited the same line, and  just squeezed the rep mod code I was suppost to add back into the line where the image award mod told me to replace) and I get the error CANNOT FETCH POST INFO..... so I remove the little rep mod code I'm suppost to add in ... and everything is fine...... >__> but I need to fit this Rep Mod code back in so the reputation mod will work properly...

any suggestions??

code that I need to add back in somehow

#---------[ 7. FIND (line:186) ]---------------------------------------------------
#

u.num_posts, u.registered, u.admin_note,


#
#---------[ 8. AFTER ADD ]---------------------------------------------------
#


 SUM(r.rep_plus) AS count_rep_plus, SUM(r.rep_minus) AS count_rep_minus, u.reputation_enable,

My current code w/ image awards mod and rep mod in there in there
(I've tried just to add it in there normally where it says ... but that doesn't work)

// Retrieve the posts (and their respective poster/online status)
$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note,SUM(r.rep_plus) AS count_rep_plus, SUM(r.rep_minus) AS count_rep_minus, u.reputation_enable, u.imgaward, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
while ($cur_post = $db->fetch_assoc($result))
{

Thanks in advance.

-Geoff

Re: ERROR: Cannot Fetch Post Info

I believe there's more reputation mod code for that query that includes a group by statement

3 (edited by GeoffG 2007-04-25 11:06)

Re: ERROR: Cannot Fetch Post Info

read me

##
##
##        Mod title:  Reputation System 
##
##      Mod version:  2.2.0
##   Works on PunBB:  1.2.*
##     Release date:  2006-04-24
##           Author:  hcs (hcs@mail.ru)
##  Original Author:  Sakuza (sakuza@sakuza.com) (Mod version:  1.0.1    )
##
##      Description:  Allow users to give reputation points to other users.
##              Users necessarily specify the reason of change of reputation and can look who it changed.
##                    Admins & mods can delete any reputation any users.
##
##   Affected files:   viewtopic.php, profile.php
##
##       Affects DB:  Table users drop column if exists:
##            reputation_plus
##            reputation_minus
##
##              New table: reputation      
##                    New options:
##                      'o_reputation_timeout'
##
##            Notes:  1. The install_mod routine currently works only for MySQL.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##


If  you are already installed Reputation system 1.0.1 of Sakuza 
follow the instructions in the upgrade_from_1.0.1.txt

If  you are already installed Reputation system 2.*.* of hcs 
follow the instructions in the upgrade_from_2.*.*.txt


Follow this instruction only if new install of Reputation mod

#
#---------[ 1. UPLOAD ]------------------------------------------------------
#

install_mod.php
reputation.php
include/reputation/rep_viewtopic.php
plugins/AP_Reputation.php
img/warn_plus.gif
img/warn_minus.gif
lang/English/reputation.php

#---------[ 2. RUN ]---------------------------------------------------
#

install_mod.php

#
#---------[ 3. DELETE ]---------------------------------------------------
#

install_mod.php

#
#---------[ 4. OPEN ]---------------------------------------------------
#

viewtopic.php


#
#---------[ 5. FIND (line:41) ]---------------------------------------------------
#

require PUN_ROOT.'lang/'.$pun_user['language'].'/topic.php';


#
#---------[ 6. AFTER, ADD ]---------------------------------------------------
#

require PUN_ROOT.'lang/'.$pun_user['language'].'/reputation.php';


#
#---------[ 7. FIND (line:186) ]---------------------------------------------------
#

u.num_posts, u.registered, u.admin_note,


#
#---------[ 8. AFTER ADD ]---------------------------------------------------
#


 SUM(r.rep_plus) AS count_rep_plus, SUM(r.rep_minus) AS count_rep_minus, u.reputation_enable,
 
 
#
#---------[ 9. FIND (line:186) ]---------------------------------------------------
#
 

 WHERE p.topic_id='.$id.'  

 
#
#---------[ 10. BEFORE ADD ]---------------------------------------------------
#
 
 LEFT JOIN '.$db->prefix.'reputation as r ON (r.user_id=u.id) 


#
#---------[ 11. FIND (line:186) ]---------------------------------------------------
#


ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true)
 
 
#
#---------[ 12. BEFORE ADD ]---------------------------------------------------
# 

 GROUP BY p.id 
 
#
#---------[ 13. FIND (line:322) ]---------------------------------------------------
#
    
<?php if (count($user_info)) echo "\t\t\t\t\t".implode('</dd>'."\n\t\t\t\t\t", $user_info).'</dd>'."\n"; ?>


#
#---------[ 14. AFTER, ADD ]-----------------------------------------------------
#

<?php require(PUN_ROOT.'include/reputation/rep_viewtopic.php'); ?>


#
#---------[ 15. OPEN ]---------------------------------------------------
#

profile.php


#
#---------[ 16. FIND (line:~802) ]---------------------------------------------------
#

            $form = extract_elements(array('disp_topics', 'disp_posts', 'show_smilies', 'show_img', 'show_img_sig', 'show_avatars', 'show_sig', 'style'));


#
#---------[ 17. AFTER, ADD ]-----------------------------------------------------
#

            $form['reputation_enable'] = pun_linebreaks(trim($_POST['reputation_enable']));
            if (!isset($form['reputation_enable']) || $form['reputation_enable'] != '1') $form['reputation_enable'] = '0';



#
#---------[ 18. FIND (line:~1435) ]---------------------------------------------------
#


                            <p class="clearb"><?php echo $lang_profile['Paginate info'] ?> <?php echo $lang_profile['Leave blank'] ?></p>
                        </div>
                    </fieldset>
                </div>
#
#---------[ 19. AFTER, ADD ]-----------------------------------------------------
#

<?php require(PUN_ROOT.'include/reputation/rep_profile.php'); ?>

O_O thats the only line the 2 mods conflict at ... and I know there is a way aroundit because I've seen both mods on other punbb forums before >__<

I've been messin around with the code but ... nothin =/
(wish I knew more php sad)

and like I said I remove that one part where the rep mod needs to be added ... and the image awards mod works fine but .. the rep mod does not xD (durka durrr). So is there another area where I can input that code?? or am I going to need a whole need code all together (Geoff <---- cannot code in php) sad

Re: ERROR: Cannot Fetch Post Info

See steps 9-12, those all edit the same query wink

5 (edited by GeoffG 2007-04-25 18:38)

Re: ERROR: Cannot Fetch Post Info

*sigh*

I hate being code dumb =[

so what exactly would I change to allow it to all work properly?

Re: ERROR: Cannot Fetch Post Info

Apply steps 9-12?

Re: ERROR: Cannot Fetch Post Info

thanks.

Smarty <3