Vars not posting in admin panel scripts.

Support for phpBB mods/hacks.

Moderator: Moderators

Vars not posting in admin panel scripts.

Postby Mike O on Wed Jan 07, 2009 11:15 am

Hello folks :)
I have been working on a phpbb2 board for some time now for my team 'carl sagan' at SETI@Home.
What my mod does is add some control values (to the profile edit page) for a team member's graphic that can be used in signatures at most forums. The team member's graphic is created 'on the fly' by a script called sagan.php based on the values for it stored using the edit profile page in phpBB2.
It looks like this:

Now that you know what Im trying to do, it will help.
This mod works great and I have changed all the pages that pass or use the profile data... and the data is stored correctly in mysql. All is good as far as that part goes.
The bad thing is... When I try to edit the a users profile under the Admin Panel, The vars are NOT passed back in to the admin_users.php script:

Here is an example of one data item added. Its the color of the top area of the graphic. Its in side the user_edit_body.tpl page.
Code: Select all
      <td align="right" class="row1"><span class="gen">Name Color:</span></td>
      <td class="row2"><a href="javascript:pickColor('pick_name');" id="pick_name"
style="border: 1px solid #000000; font-family:Verdana; font-size:10px;
text-decoration: none;">&nbsp;&nbsp;&nbsp;</a>
        <input id="pick_namefield" size="7"
onChange="relateColor('pick_name', this.value);" class="post" name="TRGBR" value="{TRGBR}">
        <script language="javascript">relateColor('pick_name', getObj('pick_namefield').value);</script></td>

name="TRGBR" value="{TRGBR}" is the var added.. the java in the lines above are for a color picker.. please remember that this works fine in the normal usage. Its the admin panel that is messing up so it has NOTHING to do with the java scripts.
Ok.. when I click submit while editing a users porfile, it should 'POST' the new vars the same as the other vars but for some reason, they are NOT getting back.
This is the part that graps the posted vars in admin_users.php correct?:
Code: Select all
      $occupation = ( !empty($HTTP_POST_VARS['occupation']) ) ? trim(strip_tags( $HTTP_POST_VARS['occupation'] ) ) : '';
      $interests = ( !empty($HTTP_POST_VARS['interests']) ) ? trim(strip_tags( $HTTP_POST_VARS['interests'] ) ) : '';
      $TGRBR = ( !empty($HTTP_POST_VARS['TRGBR']) ) ? trim(strip_tags( $HTTP_POST_VARS['TRGBR'] ) ) : '';

You probably reconize the first 2 lines.. the last one is my added one.
When I do something like this:
echo $interest." ".$TRGBR;
The interest string shows I.E. "music,computers,blah blah" but there is NOTHING for the $TRGBR variable!
Somewhere, the $TRGBR variable is not making it.
I have been ripping my hair out on and off for weeks trying to figure why this is happening. I don't understand why it works fine in the regular pages but I can't get it working in the admin pages. I can't find any place else where they could be getting lost.

I should mention that the Variables I added ARE making it to the user_edit_body.tpl script. They showing up correctly.
Im using phpBB 2.0.23
Any help would be great!
User avatar
Mike O
Registered User
Registered User
Posts: 1
Joined: Wed Jan 07, 2009 10:37 am

Return to phpBB Mods

Who is online

Users browsing this forum: No registered users and 4 guests