Whats wrong with this code?

Support for IntegraMOD 141

Moderator: Integra Moderator

Whats wrong with this code?

PostAuthor: Pogue Moran » Wed Feb 21, 2007 7:51 pm

this somewhat with my phpbbplus board with PCP but am having problems getting this to work on IM 141. For some reason my def_userfuncs_custom.php code isn't working right and when I go to alter page display the page goes blank.

Here is the code:

Code: Select all
//----------------------------------- // // user_repprof output function // //----------------------------------- function pcp_output_repprof($field_name, $view_userdata, $map_name='') {    global $board_config, $phpbb_root_path, $phpEx, $lang, $images, $userdata, $db;    global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields;      $img = '';    $res = '';    $txt = '';    $img = get_reputation_medals($view_userdata['user_reputation']) . " <br><span>(<a>" . $lang['Votes'] . "</a>: " . $row_rep['count_reps'] . ")</span>";       // result       $res = pcp_output_format($field_name, $txt, $img, $map_name);        return $res; }


def_userfields.php

Code: Select all
     'user_repprof' => array(             'lang_key'     => 'Reputation',             'class'        => 'generic',             'type'         => 'VARCHAR',             'dsp_func'     => 'pcp_output_repprof',          ),  


Attached also is the install instructions for the original mod.
Attachments
repmod.zip
Reputation Mod
(562.84 KiB) Downloaded 141 times
Last edited by Pogue Moran on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Pogue Moran
Members
Members
 
Posts: 74
Likes: 0 post
Liked in: 0 post
Joined: Sat Jun 24, 2006 4:48 pm
Cash on hand: 0.00

Re: Whats wrong with this code?

PostAuthor: Teelk » Wed Feb 28, 2007 10:21 pm

You'll pretty much have to incorporate the entire viewtopic.php/usercp_viewprofile.php code into the function.

This part specifically...
Code: Select all
    // START ADD Reputation Mod v.1.0.0     $reputation = '';     if ($postrow[$i]['user_id'] != ANONYMOUS)     {         if ($rep_config['rep_disable'] == 0)         {             if ($postrow[$i]['user_reputation'] == 0)             {                 $reputation = $lang['Zero_reputation'];             } else             {                 if ($rep_config['graphic_version'] == 0)                 {                     // Text version                     $reputation =  $lang['Reputation'] . ": ";                     if ($postrow[$i]['user_reputation'] > 0)                     {                         $reputation .= "<strong><font>" . round($postrow[$i]['user_reputation'],1) . "</font></strong>";                     } else {                         $reputation .= "<strong><font>" . round($postrow[$i]['user_reputation'],1) . "</font></strong>";                     }                     $reputation_add = '';                 } else {                     // Graphic version                     get_reputation_medals($postrow[$i]['user_reputation']);                 }             }             $reputation .=  " <a><img><img></a>";             $sql = "SELECT COUNT(user_id) AS count_reps                     FROM " . REPUTATION_TABLE . " AS r                     WHERE r.user_id = " . $postrow[$i]['user_id'] . "                     GROUP BY user_id";             if ( !($result = $db->sql_query($sql)) )             {                 message_die(GENERAL_ERROR, "Could not obtain reputation stats for this user", '', __LINE__, __FILE__, $sql);             }             $row_rep = $db->sql_fetchrow($result);             if ($row_rep)             {                 $reputation .= "<br><a>" . $lang['Votes'] . "</a>: " . $row_rep['count_reps'];             }         }     }     // END ADD Reputation Mod v.1.0.0


- $postrow[$i] being $view_userdata
- make $rep_config a global
- and $txt = $reputation; or $img = $reputation; Could be one or the other, or you may have to split it up, I'm not sure as I'm not familiar with the inner workings of the MOD.
Last edited by Teelk on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Teelk
Dev Team
Dev Team
 
Posts: 1309
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 14, 2006 5:25 pm
Cash on hand: 0.00
Location: Canada


Return to IntegraMOD 141

Who is online

Registered users: Google [Bot], Helter, Majestic-12 [Bot]