Page 1 of 1

[Solved] Job Mod

PostPosted: Mon May 08, 2006 11:00 pm
Author: ayasha
need some help with the job mod.

i installed this on my forum some time ago, but had a problem with one of the file edits. it does not seem to keep this mod from working, but i think it would be nice to have this edit in, so the jobs can be viewed in the post. i just cannot find where it tells me to find and i am thinking all it does, is show the members job in their post. correct me if i am wrong. <img>

thanks in advance

cleo

here is the install instructions for the templates/*/viewtopic_body.tpl


#
#-----[ OPEN ]------------------------------------------
#
/templates/*/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------
#
<span>{postrow.POSTER_POSTS}<br>

#
#-----[ AFTER, ADD ]------------------------------------------
#
<span>{L_JOBS}: {postrow.JOBS}<br>



here is my viewtopic_body.tpl

well, i have tried to post this file here in quotes, but it does not hold it, and then it stretches the post way out. so i am attaching it

Re: Job Mod

PostPosted: Tue May 09, 2006 1:01 am
Author: found it
This is because of PCP which controls everything in view_topic.php with regards to the authors details...I do not know how to do it but MR DSl does if you can get hold of him....

p.s. is there not a PCP version out there for job mod..?

:mrgreen:

PostPosted: Tue May 09, 2006 6:52 am
Author: ayasha
thank you found it :lol:

PostPosted: Wed May 10, 2006 4:45 am
Author: MrDSL
I never use the mod but I happen to keep the code I had from a request long ago.

Code: Select all
 //----------------------------------- // // user_jobname output function // //----------------------------------- function pcp_output_jobname($field_name, $view_userdata, $map_name='') {    global $board_config, $phpbb_root_path, $phpEx, $lang, $images, $userdata, $server_url, $db;    global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields, $table_prefix;      $txt = '';    $img = '';    $res = '';    $current_user_id = $view_userdata['user_id'];      if (empty($jobs_array[$current_user_id][0]))    {       $sql = "SELECT `job_name`          FROM " . EMPLOYED_TABLE . "          WHERE user_id = '$current_user_id'";       if ( !($result = $db->sql_query($sql)) )       {          message_die(GENERAL_ERROR, $lang['jobs_error_temployed'], '', __LINE__, __FILE__, $sql);       }       $sql_count = $db->sql_numrows($result);         $jobs_array[$current_user_id] = array();       for ($iv = 0; $iv <sql_count>sql_fetchrow($result) ))          {             message_die(GENERAL_ERROR, $lang['jobs_error_temployed'], '', __LINE__, __FILE__, $sql);          }            $jobs_array[$current_user_id][] = ucfirst($row['job_name']);          $var2 = $row['job_name'];       }      }      if ( $view_userdata['user_id'] != ANONYMOUS )    {    if (!empty($jobs_array[$current_user_id][0]))    {       $jobs = implode(', ', $jobs_array[$current_user_id]);       $txt = $jobs;    }    else    {       $jobs = $lang['jobs_unemployed'];       $txt = $jobs;    }       // result       $res = pcp_output_format($field_name, $txt, $img, $map_name);    }    return $res; }

PostPosted: Wed May 10, 2006 4:54 am
Author: ayasha
so what do i do with this code? <img> where do i put it?

PostPosted: Thu May 11, 2006 6:09 am
Author: ayasha
bumping...can anyone tell me where to put this code? i cannot find this code in my index_body.tpl

<span>{postrow.POSTER_POSTS}<br>

Re: Job Mod

PostPosted: Thu May 11, 2006 6:30 am
Author: Dragonsys
Mr DSL's code would go in
profilcp/def/def_userfuncs_custom.php

Just find
Code: Select all
?>
and add that code before it.

PostPosted: Thu May 11, 2006 6:31 am
Author: Dragonsys
"cleo";p="5490" wrote:bumping...can anyone tell me where to put this code? i cannot find this code in my index_body.tpl

<span>{postrow.POSTER_POSTS}<br>


What exactly are you trying to do with that code? Can you just post that section of the install doc?
That is also handled by PCP

PostPosted: Thu May 11, 2006 6:32 am
Author: ayasha
thank you Dragonsys <img>

PostPosted: Thu May 11, 2006 6:37 am
Author: ayasha
"Dragonsys";p="5495" wrote:
"cleo";p="5490" wrote:bumping...can anyone tell me where to put this code? i cannot find this code in my index_body.tpl

<span>{postrow.POSTER_POSTS}<br>


What exactly are you trying to do with that code? Can you just post that section of the install doc?
That is also handled by PCP


if you look up at the first postof this thread, that is what the install instructions says to do to the view_body.tpl. and then MrDSL posted the code i needed here, but did not tell me what file to put it in, or where to put it, so if i understand you right, i do not need to do that edit to the veiw_body.tpl, but to add the code he gave me to the profilcp/def/def_userfuncs_custom.php?



#
#-----[ OPEN ]------------------------------------------
#
/templates/*/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------
#
<span>{postrow.POSTER_POSTS}<br>

#
#-----[ AFTER, ADD ]------------------------------------------
#
<span>{L_JOBS}: {postrow.JOBS}<br>

PostPosted: Thu May 11, 2006 12:26 pm
Author: Dragonsys
"cleo";p="5498" wrote:if you look up at the first postof this thread, that is what the install instructions says to do to the view_body.tpl. and then MrDSL posted the code i needed here, but did not tell me what file to put it in, or where to put it, so if i understand you right, i do not need to do that edit to the veiw_body.tpl, but to add the code he gave me to the profilcp/def/def_userfuncs_custom.php?


Doh, I completely missed that....

Yes, put the code Mr DSL gave you in profilcp/def/def_userfuncs_custom.php
and you do not need to edit view_body.tpl

Re: Job Mod

PostPosted: Thu May 11, 2006 12:46 pm
Author: Dragonsys
OPEN profilcp/def/def_usermaps.php
FIND:
Code: Select all
                        'user_points' => array(                                 'txt'          => true,                                 'style'        => '<div>%s</div>',                             ),

AFTER ADD]                         'user_jobname' => array(                                 'dsp_func'     => 'pcp_output_jobname',                                 'txt'          => true,                                 'style'        => '<div>%s</div>',                             ),[/code]

That should add the job name to the posting view.. I think that is what you were wanting...

PostPosted: Thu May 11, 2006 12:56 pm
Author: MrDSL
Most pcp adaptation is the same. Once you have the actual pcp_output code which always goes in def_userfuncs_custom or similar then it needs a

field definition and a user definition. The field definition sets the output up and user definition displays it..

in def_userfields.php

Code: Select all
              'user_job' => array(                 'lang_key'     => 'Jobs',                 'class'        => 'generic',                 'type'         => 'VARCHAR',                 'dsp_func'     => 'pcp_output_jobname',                 'visibility'   => true,             ),


and in def_usermaps.php

Code: Select all
                    'user_jobname' => array(                           'txt'          => true,                         'style'        => '<div>%s</div>',                      ),

Re: Job Mod

PostPosted: Thu May 11, 2006 12:59 pm
Author: Dragonsys
I did forget the userfield...
man, this must have been a longer week than I thought.. I'm forgetting all kinds of things today <img>

Re: Job Mod

PostPosted: Thu May 11, 2006 5:45 pm
Author: ayasha
"Dragonsys";p="5576" wrote:That should add the job name to the posting view.. I think that is what you were wanting...


yes, that is what i was wanting, but it did not work, it still is not showing in the posting view. <img>

Re: Job Mod

PostPosted: Fri May 12, 2006 5:36 am
Author: Dragonsys
That is becuase i forgot part of it... sorry

OPEN profilcp/def/def_userfields.php
FIND:
Code: Select all
            'user_buddy_ignored_by_display' => array(                 'lang_key'     => 'Buddy_ignored_by_display',                 'class'        => 'generic',                 'type'         => 'TINYINT',                 'get_mode'     => 'LIST_RADIO',                 'values'       => 'list_yes_no',             ),

AFTER ADD]         'user_job' => array(             'lang_key'     => 'Jobs',             'class'        => 'generic',             'type'         => 'VARCHAR',             'dsp_func'     => 'pcp_output_jobname',             'visibility'   => true,          ),[/code]

PostPosted: Fri May 12, 2006 6:44 am
Author: ayasha
ok, i did that, and it still is not showing in the posting view. i will look at this more later, got housework to do today :lol:

EDIT: i fixed it, i had to go into the pcp wizard and alter the page display to show the job name <img>

PostPosted: Tue Jan 02, 2007 11:27 am
Author: ayasha
well, i am back on this again, and i was wondering is there a way to edit this so you see

Jobs: Canvas Maker, Painting Hanger

rather than just

Canvas Maker, Painting Hanger

this way newer members will know what it is.

thanks in advance

cleo

PostPosted: Tue Jan 02, 2007 12:22 pm
Author: IntegraMOD
You could try looking in the language files or the block template files

PostPosted: Tue Jan 02, 2007 1:50 pm
Author: ayasha
if i understood the code well enough, i would have already done that gffb, but even if i do look in those files, (and i have before) i end up destroying an entire forum.