Fork me on GitHub

[SOLVED] MOD to use the Avatar 2.1 module pics into PNphpBB2  Bottom

  • I would like to know if it's possible to let user upload only one avatar and use it for the "avatar" module of "member list (profile1.2)" AND pnphpbb2 forum.
    Is it possible or the two profile MUST stay separated? :(
  • you could probably override the templates in pnphpbb2 (assuming there are some) and change tha call to the zikula avatar.
  • I installed avatar 2.1 module, but it doesn't work :(

    Does it create a SQL table?
    I can't find it.

    I have to investigate why doesn't work selecting an avatar (i select it but then doesn't happen, user is still without avatar)
  • can you edit any of your user properties? (realname, etc)
  • Yes, I changed a propriety from viewable by "everyone" to viewvable by "only registered user" just right now,
    why do you ask it?
  • If from admin panel I click "view user that use this avatar" zikula says:

    "Exit-Handler: Exiting after SQL-error"

    In the top of the theme (above zikula's header) says:
    "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND pn_uda_value="002.gif"' at line 1
    SELECT pn_uda_id AS "uda_id",pn_uda_propid AS "uda_propid",pn_uda_uid AS "uda_uid",pn_uda_value AS "uda_value" FROM pn_user_data AS tbl WHERE pn_uda_propid= AND pn_uda_value="002.gif""


    Does anyone know the name of the table that create tha avatar module 2.1?
    Is it "pn_uda_propid" ?!

    If so: this module does not create the table, here is the problem :(



    edited by: lordevol, Apr 22, 2009 - 07:43 PM
  • lordevol

    Yes, I changed a propriety from viewable by "everyone" to viewvable by "only registered user" just right now,
    why do you ask it?


    no - I mean in your personal profile - can you edit anything and make it "stick" (for example, your real name or AIM info).

    I ask because this site had the same trouble for a while and we hashed that out on the forums around here somewhere. Everyone's avatars were messed up and couldn't change them...

    could be a permissions problem for where you are uploading the avatars to...
  • craigh

    I ask because this site had the same trouble for a while and we hashed that out on the forums around here somewhere.


    here is that discussion
  • Thaks for your help, but the profile module is ok,
    I can change and store every field,
    this is an avatar module problem :(

    So it's better opening a new topic
  • I solved the problem with the avatar module.
    So I can go on with this project: use the avatar loaded with the avatar 2.1 module in the pnphpbb2 view_topic template.

    Today I understood that pnphpbb2 does not use pnrender, so I can't clone the way that "other module" calls those images:

    in the .php file:

    Code

    // display
        $pnRender = pnRender::getInstance('Avatar', false, null, true);
        $pnRender->assign('avatars', $avatars);
        $pnRender->assign('allow_uploads', $allow_uploads);
        $pnRender->assign('user_avatar', pnUserGetVar('user_avatar'));
        $pnRender->assign('allavatarscount', $allavatarscount);
        $pnRender->assign('page', $page);
        $pnRender->assign('perpage', $perpage);


    and in the template:

    Code

    <!--[$pncore.user._YOURAVATAR|pnvarprepfordisplay]-->



    So how can I get access to that img-URL from a non pnrender module in zikula? Anyone have an idea?



    edited by: lordevol, Apr 24, 2009 - 02:09 PM
  • I'm very happy, now I can take the Avatar 2.1 module pics on the pnhpbb2 module!

    Example: show the Avatar 2.1 pics into into the pnphpbb2 member list:

    PHP

    file modules/PNphpBB2/memberlist.php

    from:

    Code

    $template->assign_block_vars('memberrow', array(
                'ROW_NUMBER' => $i + ( $start + 1 ),
                'ROW_COLOR' => '#' . $row_color,
                'ROW_CLASS' => $row_class,
    /* Begin PNphpBB2 Module */
    /*          'USERNAME' => $username, */
                'USERNAME' => pnVarPrepForDisplay($username),
    /* End PNphpBB2 Module */
                'FROM' => $from,
                'JOINED' => $joined,
                'TERM_IMG' => $member_term_img,
                'POSTS' => $posts,
                'AVATAR_IMG' => $poster_avatar,
                'PROFILE_IMG' => $profile_img,
                'PROFILE' => $profile,
                'SEARCH_IMG' => $search_img,
                'SEARCH' => $search,
                'PM_IMG' => $pm_img,
                'PM' => $pm,
                'EMAIL_IMG' => $email_img,
                'EMAIL' => $email,
                'WWW_IMG' => $www_img,
                'WWW' => $www,


    to:

    Code

    /* Mia modifica */
    $numeroutente=pnUserGetIDFromName($username);
    $nomefileavatar = pnUserGetVar('_YOURAVATAR', $numeroutente);
    if (!($nomefileavatar))  
    {  $indirizzoavatar = '<img src="http:/www.xxx.xx/xxxx/modules/PNphpBB2/images/noavatar.gif">'; }  /* This is to assign a standard image to people who don't upload their personalized avatar */
    else { $indirizzoavatar = '<img src="http://www.xxx.xx/xxxx/images/avatar/' . $nomefileavatar . '">'; }
    /*  Mia modifica */


           
            $template->assign_block_vars('memberrow', array(
                'ROW_NUMBER' => $i + ( $start + 1 ),
                'ROW_COLOR' => '#' . $row_color,
                'ROW_CLASS' => $row_class,
    /* Begin PNphpBB2 Module */
    /*          'USERNAME' => $username, */
                'USERNAME' => pnVarPrepForDisplay($username),
    /* End PNphpBB2 Module */
                'FROM' => $from,
                'JOINED' => $joined,
                'TERM_IMG' => $member_term_img,
                'POSTS' => $posts,
                'AVATAR_IMG' => $poster_avatar,
                'PROFILE_IMG' => $profile_img,
                'PROFILE' => $profile,
                'SEARCH_IMG' => $search_img,
                'SEARCH' => $search,
                'PM_IMG' => $pm_img,
                'PM' => $pm,
                'EMAIL_IMG' => $email_img,
                'EMAIL' => $email,
                'WWW_IMG' => $www_img,
                'WWW' => $www,
                'AVATAR_ZIKULA' => $indirizzoavatar,



    Template


    file modules/PNphpBB2/templates/PNTheme/memberlist_body.tpl

    From:

    Code

    <th> {L_PM} </th>
    <th> {L_USERNAME} </th>      
    <th> {L_EMAIL} </th>
    <th>{L_JOINED}</th>
    <th>{L_POSTS}</th>
    <th>{L_WEBSITE}</th>
    <th>Avatar Forum</th>
    </tr>
    <!-- BEGIN memberrow -->
    <tr>
    <td class="{memberrow.ROW_CLASS}" align="center"> {memberrow.ROW_NUMBER} </td>
    <td class="{memberrow.ROW_CLASS}" align="center"> {memberrow.PM_IMG} </td>
    <td class="{memberrow.ROW_CLASS}" align="center"><a href="{memberrow.U_VIEWPROFILE}">{memberrow.USERNAME}</a></td>
    <td class="{memberrow.ROW_CLASS}" align="center"> {memberrow.EMAIL_IMG} </td>
    <td class="{memberrow.ROW_CLASS}" align="center"><span class="gensmall">{memberrow.JOINED}{memberrow.TERM_IMG}</span></td>
    <td class="{memberrow.ROW_CLASS}" align="center">{memberrow.POSTS}</td>
    <td class="{memberrow.ROW_CLASS}" align="center"> {memberrow.WWW_IMG} </td>
    <td class="{memberrow.ROW_CLASS}" align="center"> {memberrow.AVATAR_IMG} </td>
    </td>
    </tr>
    <!-- end membe rrow -->
    <tr align="center">
    <td class="cat" colspan="8">


    to:

    Code

    <th> {L_PM} </th>
    <th> {L_USERNAME} </th>      
    <th> {L_EMAIL} </th>
    <th>{L_JOINED}</th>
    <th>{L_POSTS}</th>
    <th>{L_WEBSITE}</th>
    <th>Avatar Forum</th>
    <th>Avatar Zikula</th>
    </tr>
    <!-- BEGIN memberrow -->
    <tr>
    <td class="{memberrow.ROW_CLASS}" align="center"> {memberrow.ROW_NUMBER} </td>
    <td class="{memberrow.ROW_CLASS}" align="center"> {memberrow.PM_IMG} </td>
    <td class="{memberrow.ROW_CLASS}" align="center"><a href="{memberrow.U_VIEWPROFILE}">{memberrow.USERNAME}</a></td>
    <td class="{memberrow.ROW_CLASS}" align="center"> {memberrow.EMAIL_IMG} </td>
    <td class="{memberrow.ROW_CLASS}" align="center"><span class="gensmall">{memberrow.JOINED}{memberrow.TERM_IMG}</span></td>
    <td class="{memberrow.ROW_CLASS}" align="center">{memberrow.POSTS}</td>
    <td class="{memberrow.ROW_CLASS}" align="center"> {memberrow.WWW_IMG} </td>
    <td class="{memberrow.ROW_CLASS}" align="center"> {memberrow.AVATAR_IMG} </td>
    <td class="{memberrow.ROW_CLASS}" align="center"> {memberrow.AVATAR_ZIKULA}  </td>
    </tr>
    <!-- end membe rrow -->
    <tr align="center">
    <td class="cat" colspan="9">


    It was so difficoult but in a week I wil made the whloe MOD to use only one profile shared between zikula and pnphpbb2



    edited by: lordevol, Apr 24, 2009 - 06:16 PM
  • 0 users

This list is based on users active over the last 60 minutes.