user pic in other pages

Ermöglicht es dem Benutzer ein Bild in sein Profil einzufügen.

Beitragvon Found it » 24. Jul 2006 23:12

hi

I have been using the profile pic made by Acid and though it is a good mod it does not resize....

I then found your mod which is excellant the only problem i have is I managed (through copying and pasting ) to allow the photo to show in other pages....

Basically I was hoping if you knew how easy it was to show the pic in groupcp and memberlist or any other page on my site...?

thanks for your time ..your great mods and any answer you give..

:D :D

Added after 1 hours 1 minutes:

hi

Thanks for reading ...but after doing a search.. :oops: :oops:

I found the answer...sorry for wasting your time but thank you for a brilliant mod....

:D :D
Found it
 
Beiträge: 5
Registriert: 24. Feb 2006 00:07

Beitragvon AmigaLink » 25. Jul 2006 07:34

It makes me happy you the MOD pleases and which you found the solution for your question. 8)
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon Found it » 25. Jul 2006 14:37

Hi

Just a quick question...I have managed to get the photo image where i need it to go except on one page ...this is from a mod called the friends mod but I cannot seem to get it to show he users image only the default no image ....

here is the page

Code: Alles auswählen
<?php
/***************************************************************************
*                                friends.php
*                            -------------------
*   begin                : Saturday, May 22, 2004
*   copyright            : (C) Wensheng Wang
*   email                : wensheng_wang@yahoo.com
*
***************************************************************************/

/***************************************************************************
*
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
// Added to enable bbcode or html in comments, invitations, and messages...
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);

function bbdecode_all($bbd_msg, $bbd_bbuid)
{
        // Based on viewtopic.php
        $bbd_msg = bbencode_second_pass( $bbd_msg, $bbd_bbuid);
        $bbd_msg = make_clickable($bbd_msg);
        $bbd_msg = smilies_pass($bbd_msg);
        $bbd_msg = str_replace("\n", "\n<br />\n", $bbd_msg);
        return $bbd_msg;
}

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_PROFILE);
init_userprefs($userdata);
//
// End session management
//
//User not logged in, there's no point to go on
if (!$userdata['session_logged_in'])
{
   redirect(append_sid("login.$phpEx?redirect=friends.$phpEx", true));
}

$is_friend=0;



if ( ( empty($HTTP_GET_VARS[POST_USERS_URL]) && empty($HTTP_POST_VARS[POST_USERS_URL]) )
     || $HTTP_GET_VARS[POST_USERS_URL] == $userdata['user_id']
     || $HTTP_POST_VARS[POST_USERS_URL] == $userdata['user_id'] )
{
      $profiledata=$userdata;
      $is_self = 1;
}
else
{
   $user_id = ( isset($HTTP_GET_VARS[POST_USERS_URL]) ) ? $HTTP_GET_VARS[POST_USERS_URL] : $HTTP_POST_VARS[POST_USERS_URL];

   //get requested user's profile
   if(!($profiledata = get_userdata($user_id) ) )
   {
      //No such user
      message_die(GENERAL_ERROR, 'No Such User<br><a href="orioncp.php?mode=editprofile">Your Page</a>', '');
      //redirect("home.phpEX?page=2"");
   }
   if($profiledata['view_permission'])
   {
      //not logged in AND permission not zero
      message_die(GENERAL_ERROR, 'You have no permission to view this user<br><a href="orioncp.php?mode=editprofile">Your Page</a>', '');
      //redirect("orioncp.$phpEx?mode=editprofile"");
   }
   $sql = "SELECT *
      FROM " . FRIENDS_TABLE . "
      WHERE user_a = " . $userdata['user_id'] . "
      AND user_b = " . $profiledata['user_id'];
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
   }
   if ( $row = $db->sql_fetchrow($result) )
   {
      $is_friend = 1;
   }
   $db->sql_freeresult($result);
}

$user_id=$matchuser[$i]['user_id'];

//
// Set default email variables
//
$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path']));
$script_name = ( $script_name != '' ) ? $script_name . '/friends.'.$phpEx : 'friends.'.$phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';

$server_url = $server_protocol . $server_name . $server_port . $script_name;

//
// End page specific functions
// ---------------------------

//
// Start of program proper
//
if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
   $mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];

   if ( $mode == 'popup' )
   {
      $gen_simple_header = TRUE;
   
      $page_title = $lang['New FROM FRIENDS'];
      include($phpbb_root_path . 'includes/page_header.'.$phpEx);
   
      $template->set_filenames(array(
         'body' => 'snw_popup.tpl')
      );
   
       $l_new_message = "";
       $l_new_approve = "";
      if ( $userdata['friend_pending'] )
      {
         $l_new_message .= $lang['New_friend_pending'];
         $l_new_approve = $lang['New_friend'];
      }
      if ( $userdata['comment_pending'] )
      {
         $l_new_message .= $lang['New_comment_pending'];
         $l_new_approve .= $lang['New_comment'];         
      }

      $l_new_message .= '<br />' . sprintf($lang['Click_approve'].$l_new_approve , '<a href="' . append_sid("friends.".$phpEx) . '" onclick="jump_to_inbox();return false;" target="_new">', '</a>');

      $template->assign_vars(array(
         'L_CLOSE_WINDOW' => $lang['Close_window'],
         'U_FRIENDS' => append_sid('friends.'.$phpEx),
         'L_MESSAGE' => $l_new_message)
      );
   
      $template->pparse('body');
   
      include($phpbb_root_path . 'includes/page_bottom.'.$phpEx);
      
   }
   else if ( $mode == 'add' )
   {
      if($is_self)
      {
         message_die(GENERAL_ERROR, 'Can not add friend to yourself', '', __LINE__, __FILE__);
      }         
      else if($is_friend)
      {
         message_die(GENERAL_ERROR, 'already Friends', '', __LINE__, __FILE__);
      }
      include($phpbb_root_path . 'includes/snw_add.'.$phpEx);
      exit;
   }
   else if ( $mode == 'invite' )
   {
      include($phpbb_root_path . 'includes/snw_invite.'.$phpEx);
      exit;
   }
   else if ( $mode == 'comment')
   {
      if($is_self)
      {
         message_die(GENERAL_ERROR, 'Can not make comment to yourself', '', __LINE__, __FILE__);
      }         
      else if(!$is_friend)
      {
         message_die(GENERAL_ERROR, 'Not Friends', '', __LINE__, __FILE__);
      }
      include($phpbb_root_path . 'includes/snw_comment.'.$phpEx);
      exit;
   }
   else if ( $mode == 'approve' )
   {
      include($phpbb_root_path . 'includes/snw_approve.'.$phpEx);
      exit;
   }
   else if ( $mode == 'delete' )
   {
      if(!$is_friend)
      {
         message_die(GENERAL_ERROR, 'Not Friends', '', __LINE__, __FILE__);
      }
      include($phpbb_root_path . 'includes/snw_delete.'.$phpEx);
      exit;
   }
   else if ( $mode == 'approvepc' && $is_self )
   {
      if($HTTP_GET_VARS['id'])
      {
         //TO_DO
         //Should make sure it's his comment first
         $sql = "UPDATE " . FRIENDS_COMMENTS_TABLE . "
            SET status = 1
            WHERE id = " . $HTTP_GET_VARS['id'] . "
            AND to_id = " . $userdata['user_id'];
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not update friends_comments table', '', __LINE__, __FILE__, $sql);
         }
      }
      
      $template->assign_vars(array(
         "META" => '<meta http-equiv="refresh" content="2;url=' . append_sid("friends.$phpEx") . '">')
      );

      message_die(GENERAL_MESSAGE, $lang['approved_a_comment']);
   }
   
   // JASON'S MODIFICATION
   // DESC: This will now be deletec only to serve not only approved comments but also the pending ones
   else if ( $mode == 'deletec' && $is_self)
   // ENDJMOD
   {
      if($HTTP_GET_VARS['id'])
      {
         //TO_DO
         //Should make sure it's his comment first
         $sql = "DELETE FROM " . FRIENDS_COMMENTS_TABLE . "
            WHERE id = " . $HTTP_GET_VARS['id'] . "
            AND to_id = " . $userdata['user_id'];
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not friends_comments table', '', __LINE__, __FILE__, $sql);
         }
      }
      
      $template->assign_vars(array(
         "META" => '<meta http-equiv="refresh" content="2;url=' . append_sid("friends.$phpEx") . '">')
      );

      message_die(GENERAL_MESSAGE, $lang['deleted_a_comment']);
   }
   else if ( $mode == 'search' )
   {
      include($phpbb_root_path . 'includes/usercp_email.'.$phpEx);
      exit;
   }
   else if ( $mode == 'view' )
   {
      include($phpbb_root_path . 'includes/usercp_email.'.$phpEx);
      exit;
   }
}
else if($is_self)
{
   if ( isset($HTTP_POST_VARS['submit']) )
   {
      if( isset($HTTP_POST_VARS['newpf']) )
      {
         $new_pf = explode(",", $HTTP_POST_VARS['newpf']);
         $sqlinsert = "";
         $sqldelete = "";
         $sqlupdate = "";
         $approved_users = '';
         $declined_users = '';
         $pending_users = '';
         for($i = 0; $i < count($new_pf)-1; $i++)
         {
            $tmpnf="nf" . $new_pf[$i];

                                // JASON'S MODIFICATION
                                // DESC: This queries the username of the $new_pf[$i]
            $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_id = '" . $new_pf[$i] . "'";
                              if ( !($result = $db->sql_query($sql)) )
                              {
                                message_die(GENERAL_ERROR, 'Could not query usernames', '', __LINE__, __FILE__, $sql);
                              }
                                // ENDJMOD
                               
               if(   $HTTP_POST_VARS[$tmpnf] == '1' )
            {
               $sqlinsert .= " (" . $userdata['user_id'] . "," . $new_pf[$i] . "),";
               $sqlinsert .= " (" . $new_pf[$i] . "," . $userdata['user_id'] . "),";
               $sqldelete .= $new_pf[$i] . ",";
               
               // JASON'S MODIFICATION
               // DESC: add the username to $approved_users, to be used later in $result_submit_msg
                                        while( $row = $db->sql_fetchrow($result) )
                                         {
                                             $approved_users .= $row['username'] . ',';
                                         }
                                        // ENDJMOD
            }
            else if($HTTP_POST_VARS[$tmpnf] == '0')
            {
               $sqldelete .= $new_pf[$i] . ",";
               
               // JASON'S MODIFICATION
               // DESC: A little tricky though, adds the username to $declined_users
               // if it was originally declined...
                                        while( $row = $db->sql_fetchrow($result) )
                                         {
                                                // since what is approved is also deleted in FRIENDS_PENDING_TABLE,
                                                // we will first scan if the user was originally added...
                                                // If the user was originally declined, they will only appear here and not in $sqlinsert.
                                             $approved_users_arr = explode("," , $approved_users);
                                             if (!in_array($row['username'], $approved_users_arr))
                                             {
                                                         $declined_users .= $row['username'] . ',';
                                                }
                                         }
                                         // ENDJMOD
            }
            else
            {
               $sqlupdate .= $new_pf[$i] . ",";

                                        // JASON'S MODIFICATION
               // DESC: add the username to $pending_users, to be used later in $result_submit_msg
                                        while( $row = $db->sql_fetchrow($result) )
                                         {
                                             $pending_users .= $row['username'] . ',';
                                         }
                                         // ENDJMOD
            }

                                // JASON'S MODIFICATION
                                // DESC: clean the $result for next use
                                $db->sql_freeresult($result);
                                // ENDJMOD
         }

         if($sqlinsert)
         {
            $sqlinsert = substr($sqlinsert, 0, -1);
            $sql = "INSERT INTO " . FRIENDS_TABLE . " (user_a, user_b) VALUES" . $sqlinsert;
            if ( !($result = $db->sql_query($sql)) )
            {
               message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
            }
         }
         if($sqldelete)
         {
            $sqldelete = substr($sqldelete, 0, -1);
            $sql = "DELETE FROM " . FRIENDS_PENDING_TABLE . "
               WHERE to_id = " . $userdata['user_id'] . "
               AND from_id IN (" . $sqldelete . ")";
            if ( !($result = $db->sql_query($sql)) )
            {
               message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
            }

         }
         if($sqlupdate)
         {
            $sqlupdate = substr($sqlupdate, 0, -1);
            $sql = "UPDATE " . FRIENDS_PENDING_TABLE . "
               SET status = '1'
               WHERE to_id = " . $userdata['user_id'] . "
               AND from_id IN (" . $sqlupdate . ")";
            if ( !($result = $db->sql_query($sql)) )
            {
               message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
            }
         }
      }
      //END if( isset($HTTP_POST_VARS['newpf']) )

      if( isset($HTTP_POST_VARS['newpc']) )
      {
         $new_pc = explode(",", $HTTP_POST_VARS['newpc']);
         $sqlapprove = "";
         $sqldelete = "";
         $sqllater = "";
         $approved_comments = '';
         $declined_comments = '';
         $pending_comments = '';
         for($i = 0; $i < count($new_pc)-1; $i++)
         {
            $tmpnc="nc" . $new_pc[$i];
            
                                // JASON'S MODIFICATION
                                // DESC: This queries the username of the $new_pc[$i]
            $sql = "SELECT * FROM " . USERS_TABLE . ", " . FRIENDS_COMMENTS_TABLE .
                                       " WHERE " . FRIENDS_COMMENTS_TABLE . ".id = '" . $new_pc[$i] . "'" .
                                       " AND " . USERS_TABLE . ".user_id = " . FRIENDS_COMMENTS_TABLE . ".from_id";
                              if ( !($result = $db->sql_query($sql)) )
                              {
                                message_die(GENERAL_ERROR, 'Could not query usernames', '', __LINE__, __FILE__, $sql);
                              }
                                // ENDJMOD

               if(   $HTTP_POST_VARS[$tmpnc] == '1' )
            {
               $sqlapprove .= $new_pc[$i] . ",";

                                        // JASON'S MODIFICATION
               // DESC: add the username to $approved_comments, to be used later in $result_submit_msg
               // Also added some checks so that if 2 comments from one user was approved,
               // the notification will appear only once and not user1, user2, user1, user3
                                        while( $row = $db->sql_fetchrow($result) )
                                         {
                                             $approved_comments_arr = explode("," , $approved_comments);
                                             if (!in_array($row['username'], $approved_comments_arr))
                                             {
                                                         $approved_comments .= $row['username'] . ',';
                                                }
                                         }
                                        // ENDJMOD

            }
            else if($HTTP_POST_VARS[$tmpnc] == '0')
            {
               $sqldelete .= $new_pc[$i] . ",";
                                        // JASON'S MODIFICATION
               // DESC: add the username to $declined_comments, to be used later in $result_submit_msg
                                        while( $row = $db->sql_fetchrow($result) )
                                         {
                                             $declined_comments_arr = explode("," , $declined_comments);
                                             if (!in_array($row['username'], $declined_comments_arr))
                                             {
                                                         $declined_comments .= $row['username'] . ',';
                                                }
                                         }

                                        // ENDJMOD
            }
            else
            {
               $sqllater .= $new_pc[$i] . ",";
                                        // JASON'S MODIFICATION
               // DESC: add the username to $pending_comments, to be used later in $result_submit_msg
                                        while( $row = $db->sql_fetchrow($result) )
                                         {
                                             $pending_comments_arr = explode("," , $pending_comments);
                                             if (!in_array($row['username'], $pending_comments_arr))
                                             {
                                                         $pending_comments .= $row['username'] . ',';
                                                }
                                         }

                                        // ENDJMOD
            }
                                // JASON'S MODIFICATION
                                // DESC: clean the $result for next use
                                $db->sql_freeresult($result);
                                // ENDJMOD
         }
         if($sqlapprove)
         {
            $sqlapprove = substr($sqlapprove, 0, -1);
            $sql = "UPDATE " . FRIENDS_COMMENTS_TABLE . "
               SET status = '1'
               WHERE id IN (" . $sqlapprove . ")";
            if ( !($result = $db->sql_query($sql)) )
            {
               message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
            }
         }
         if($sqldelete)
         {
            $sqldelete = substr($sqldelete, 0, -1);
            $sql = "DELETE FROM " . FRIENDS_COMMENTS_TABLE . "
               WHERE id IN (" . $sqldelete . ")";
            if ( !($result = $db->sql_query($sql)) )
            {
               message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
            }

         }
         if($sqllater)
         {
            $sqllater = substr($sqllater, 0, -1);
            $sql = "UPDATE " . FRIENDS_COMMENTS_TABLE . "
               SET status = '2'
               WHERE id IN (" . $sqllater . ")";
            if ( !($result = $db->sql_query($sql)) )
            {
               message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
            }
         }
      }
      //END if( isset($HTTP_POST_VARS['newpc']) )

      $sql = "UPDATE " . USERS_TABLE . "
            SET friend_pending = '0', comment_pending = '0'
            WHERE user_id = " . $userdata['user_id'];
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
      }

      $template->assign_vars(array(
         "META" => '<meta http-equiv="refresh" content="10;url=' . append_sid("friends.$phpEx") . '">')
      );
                // JASON'S MODIFICATION
                // Desc: Instead of echoing "you have approved friends and comments",
                // we will put a more specific process reporting reflected by $result_submit_msg
                // Refer to $newpf and $newpc above and see how it is done...
                if ($approved_users)
                {
                        $result_submit_msg = sprintf($lang['approved_users'], str_replace("," , "</b>, <b>", substr($approved_users, 0, -1)));
                }
                if ($pending_users)
                {
                        $result_submit_msg .= sprintf($lang['pending_users'], str_replace("," , "</b>, <b>", substr($pending_users, 0, -1)));
                }
                if ($declined_users)
                {
                        $result_submit_msg .= sprintf($lang['declined_users'], str_replace("," , "</b>, <b>", substr($declined_users, 0, -1)));
                }

                if ($approved_comments)
                {
                        $result_submit_msg .= sprintf($lang['approved_comments'], str_replace("," , "</b>, <b>", substr($approved_comments, 0, -1)));
                }
                if ($pending_comments)
                {
                        $result_submit_msg .= sprintf($lang['pending_comments'], str_replace("," , "</b>, <b>", substr($pending_comments, 0, -1)));
                }
                if ($declined_comments)
                {
                        $result_submit_msg .= sprintf($lang['declined_comments'], str_replace("," , "</b>, <b>", substr($declined_comments, 0, -1)));
                }

      message_die(GENERAL_MESSAGE, $result_submit_msg);
      
   }
   //END if ( isset($HTTP_POST_VARS['submit']) )
}

   //Default no parameter page
include($phpbb_root_path . 'includes/page_header.'.$phpEx);



$sql = "select *
   FROM ( " . FRIENDS_PENDING_TABLE . " f
   LEFT JOIN " . USERS_TABLE . " u on f.from_id = u.user_id )
   WHERE f.to_id = " . $profiledata['user_id'] . "
   ORDER by f.from_id";
if (!($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, "database error", __LINE__, __FILE__, $sql);
}
$n_fpending = 0;
while ($row = $db->sql_fetchrow($result))
{
   $fpending[] = $row;
   $n_fpending++;
}
$db->sql_freeresult($result);

$sql = "SELECT *
   FROM ( " . FRIENDS_COMMENTS_TABLE . " c
   LEFT JOIN " . USERS_TABLE . " u ON c.from_id = u.user_id )
   WHERE c.to_id = " . $profiledata['user_id'] . "
   ORDER BY c.id
   LIMIT 20";
// above # (20 default) is the number of friends per page
if ( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'database error', '', __LINE__, __FILE__, $sql);
}
$n_comments = 0;
while( $row = $db->sql_fetchrow($result) )
{
   $commentsdata[] = $row;
   $n_comments++;
}
$db->sql_freeresult($result);

if($is_self && ($userdata['friend_pending'] || $userdata['comment_pending'] || isset($HTTP_GET_VARS['view_pending'])))
{
   $template->set_filenames(array(
      'body' => 'friends_pending_body.tpl')
   );
   if($n_fpending)
   {
      $newpf = "";
      for($j = 0; $j < $n_fpending; $j++)
      {
                        // JASON'S MODIFICATION
                        // DESC: added this block of code to show pictures
                        $photo_img = '<img src="images/nothumbnail.jpg" alt="No Picture Available" height="60" width="50" border="0" />';
              if ( $fpending[$j]['user_photo_type']  )
              {
            switch( $fpending[$j]['user_photo_type'] )
            {
            case USER_AVATAR_UPLOAD:
               $photo_img = ( $board_config['allow_photo_upload'] ) ? '<img src="' . $board_config['photo_path'] . '/' . $fpending[$j]['user_photo'] . '" alt="" width="100" height="100" border="0" />' : '';
               break;
            case USER_AVATAR_REMOTE:
               $photo_img = ( $board_config['allow_photo_remote'] ) ? '<img src="' . $fpending[$j]['user_photo'] . '" alt="" border="0" />' : '';
               break;
         
           }
                        }
                        // ENDJMOD
                       
         //if($fpending[$j]['status'] == 0)
         //{
            $template->assign_block_vars('fpendingsrow', array(
               'DATE' => create_date($lang['DATE_FORMAT'], $fpending[$j]['date'], $board_config['board_timezone']),
               'FRIEND' => $fpending[$j]['username'],

                                        // JASON'S MODIFICATION
                                        // DESC: a few workaround to enable picture and bbcodes...
                                        'POSTER_USERPIC' => ($user_id != ANONYMOUS) ? '<img src="'.append_sid("profilepic.$phpEx?" . POST_USERS_URL . "=$user_id").'" alt="'.$poster.'">' : '',
               // bbencoding added...
               'SAY' => bbdecode_all($fpending[$j]['say'], $fpending[$j]['bbcode_uid']),
                                        // ENDJMOD
                                       
                                        'SUBNAME' => "nf" . $fpending[$j]['user_id'],
               'USERLINK' => "home.php?u=" . $friend[$j]['user_id'])
            );
            $newpf .= $fpending[$j]['user_id']. ",";
         //}
      }
      if($newpf)
      {
         $template->assign_block_vars('switch_newfpending', array(
            'NUM_NF' => $newpf)
         );
      }
   }
   if($userdata['comment_pending'])
   {
      $newpc = "";
      for($j = 0; $j < $n_comments; $j++)
      {
         if($commentsdata[$j]['status'] == 0)
         {

                                // JASON'S MODIFICATION
                                // DESC: added this block of code to show pictures
                                $photo_img = '<img src="images/nothumbnail.jpg" alt="No Picture Available" height="60" width="50" border="0" />';
                      if ( $commentsdata[$j]['user_photo_type'] && $commentsdata[$j]['user_photo'] )
                      {
                 switch( $commentsdata[$j]['user_photo_type'] )
                 {
             case USER_AVATAR_UPLOAD:
                                      $photo_img = ( $board_config['allow_photo_upload'] ) ? '<img src="' . $board_config['photo_path'] . '/' . $commentsdata[$j]['user_photo'] . '" alt="" width="100" height="100" border="0" />' : '';
                                      break;
                                 case USER_AVATAR_REMOTE:
                                      $photo_img = ( $board_config['allow_photo_remote'] ) ? '<img src="' . $commentsdata[$j]['user_photo'] . '" alt="" border="0" />' : '';
                                      break;
            
                 }
                               }
                               // ENDJMOD

            $template->assign_block_vars('cpendingsrow', array(
               'DATE' => create_date($lang['DATE_FORMAT'], $commentsdata[$j]['date'], $board_config['board_timezone']),
               'FRIEND' => $commentsdata[$j]['username'],
               'POSTER_USERPIC' => ($user_id != ANONYMOUS) ? '<img src="'.append_sid("profilepic.$phpEx?" . POST_USERS_URL . "=$user_id").'" alt="'.$poster.'">' : '',
               'COMMENT' => bbdecode_all($commentsdata[$j]['comment'], $commentsdata[$j]['bbcode_uid']),
               'SUBNAME' => "nc" . $commentsdata[$j]['id'],
               'USERLINK' => "home.php?u=" . $commentsdata[$j]['user_id'])
            );
            $newpc .= $commentsdata[$j]['id']. ",";
         }
      }
      if($newpc)
      {
         $template->assign_block_vars('switch_newcpending', array(
            'NUM_NC' => $newpc)
         );
      }
   }
   if($newpc||$newpf)
   {
      $template->assign_block_vars('switch_newpending', array());
   }
}
else
{   
   $template->set_filenames(array(
      'body' => 'friends_body.tpl')
   );
   $template->assign_block_vars('switch_fc', array());
   $sql = "SELECT *
      FROM ( " . FRIENDS_TABLE . " f
      LEFT JOIN " . USERS_TABLE . " u ON f.user_a = u.user_id )
      WHERE f.user_b = " . $profiledata['user_id'] . "
      LIMIT 20";
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not query friends information', '', __LINE__, __FILE__, $sql);
   }
   $nfriends = 0;
   while( $row = $db->sql_fetchrow($result) )
   {
      $friend[] = $row;
      $nfriends++;
   }
   $db->sql_freeresult($result);

   for($j = 0; $j < $nfriends; $j++)
   {
      $photo_img = '<img src="images/nothumbnail.jpg" height=60 width=50 border=0>';
      if ( $friend[$j]['user_photo_type']  )
      {
         switch( $friend[$j]['user_photo_type'] )
         {
            case USER_AVATAR_UPLOAD:
               $photo_img = ( $board_config['allow_photo_upload'] ) ? '<img src="' . $board_config['photo_path'] . '/' . $friend[$j]['user_photo'] . '" alt="" width="100" height="100" border="0" />' : '';
               break;
            case USER_AVATAR_REMOTE:
               $photo_img = ( $board_config['allow_photo_remote'] ) ? '<img src="' . $friend[$j]['user_photo'] . '" alt=""  border="0" />' : '';
               break;
         
         }
      }
      if($is_self)
      {
         $template->assign_block_vars('friendsrow', array(
            'FRIEND' => $friend[$j]['username'],
            'USERLINK' => "profile.php?mode=viewprofile&u=" . $friend[$j]['user_id'],
            'POSTER_USERPIC' => ($user_id != ANONYMOUS) ? '<img src="'.append_sid("profilepic.$phpEx?" . POST_USERS_URL . "=$user_id").'" alt="'.$poster.'">' : '',
            'PRIVMSG' => '<a href="privmsg.php?mode=post&u=' . $friend[$j]['user_id']. '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>',
            'MAKECOM' => '<a href="friends.php?mode=comment&u=' . $friend[$j]['user_id'] . '">' . $lang['Comment'] . '</a>',
            'DELETEF' => '<a href="friends.php?mode=delete&u=' . $friend[$j]['user_id'] . '">' . $lang['Delete'] . '</a>',
            'NEXTROW' => ($j+1)%5==0?"</tr><tr>":"")
         );
      }   
      else
      {
         $template->assign_block_vars('friendsrow', array(
            'FRIEND' => $friend[$j]['username'],
            'USERLINK' => "profile.php?mode=viewprofile&u=" . $friend[$j]['user_id'],
            'POSTER_USERPIC' => ($user_id != ANONYMOUS) ? '<img src="'.append_sid("profilepic.$phpEx?" . POST_USERS_URL . "=$user_id").'" alt="'.$poster.'">' : '',
            'PRIVMSG' => '<a href="privmsg.php?mode=post&u=' . $friend[$j]['user_id']. '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>',
            'NEXTROW' => ($j+1)%5==0?"</tr><tr>":"")
         );
      }
   }
   $pcomments = 0;
   if($is_self)
   {         
      for($j = 0; $j < $n_comments; $j++)
      {
         $date_status = create_date($lang['DATE_FORMAT'], $commentsdata[$j]['date'], $board_config['board_timezone']) . '<br>';
         $date_status .= $commentsdata[$j]['status']==2?$lang['Pending']:$lang['Approved'];
         $date_status .= '<br>';
         $date_status .= $commentsdata[$j]['status']==2? '<a href="friends.php?mode=approvepc&id='. $commentsdata[$j]['id'] . '">' . $lang['Approve'] . '</a><br><a href="friends.php?mode=deletec&id=' . $commentsdata[$j]['id'] . '">' . $lang['Delete'] . '</a><br>':'<a href="friends.php?mode=deletec&id=' . $commentsdata[$j]['id'] . '">' . $lang['Delete'] . '</a>';
         $template->assign_block_vars('commentsrow', array(
            'DATE_STATUS' => $date_status,
            'FRIEND' => $commentsdata[$j]['username'],
            'USERLINK' => "profile.php?mode=viewprofile&u=" . $commentsdata[$j]['user_id'],
            'COMMENT' => bbdecode_all($commentsdata[$j]['comment'], $commentsdata[$j]['bbcode_uid']))
         );
      }
   }
   else
   {
      for($j = 0; $j < $n_comments; $j++)
      {
         if($commentsdata[$j]['status']==1)
         {
            $template->assign_block_vars('commentsrow', array(
               'DATE_STATUS' => create_date($lang['DATE_FORMAT'], $commentsdata[$j]['date'], $board_config['board_timezone']),
               'FRIEND' => $commentsdata[$j]['username'],
               'USERLINK' => "profile.php?mode=viewprofile&u=" . $commentsdata[$j]['user_id'],
               'COMMENT' => $commentsdata[$j]['comment'])
            );
         }
      }
   }
}

if($is_self && $n_fpending)
{
   $template->assign_vars(array(
      'U_FPENDING' => '<br><a href="friends.php?view_pending">' . $lang['New_friend_pending'] . '</a>' )
   );
}

$photo_img = '<img src="images/nothumbnail.jpg" height=60 width=50 border=0>';
if ( $profiledata['user_photo_type'] )
{
         switch( $profiledata['user_photo_type'] )
   {
      case USER_AVATAR_UPLOAD:
               $photo_img = ( $board_config['allow_photo_upload'] ) ? '<img src="' . $board_config['photo_path'] . '/' . $profiledata['user_photo'] . '" width="100" height="100" alt=""  border="0" />' : '';
         break;
      case USER_AVATAR_REMOTE:
               $photo_img = ( $board_config['allow_photo_remote'] ) ? '<img src="' . $profiledata['user_photo'] . '" alt=""  border="0" />' : '';
         break;
      
   }
}

$template->assign_vars(array(
   'L_DATE' => $lang['Date'],
   'L_MESSAGE' => $lang['Message'],
   'USERNAME' => $profiledata['username'],
   'L_ACTION' => $lang['Action'],
   'POSTER_USERPIC' => ($user_id != ANONYMOUS) ? '<img src="'.append_sid("profilepic.$phpEx?" . POST_USERS_URL . "=$user_id").'" alt="'.$poster.'">' : '',
   'L_FROM' => $lang['From'],
   'L_APPROVE' => $lang['Approve'],
   'L_DELETE' => $lang['Delete'],
   'L_DECLINE' => $lang['Decline'],
   'L_LATER' => $lang['Later'],
   'L_FRIENDS' => $lang['SNW_Friends'],
   'L_FRIEND_COMMENTS' => $lang['Friend_comments'],
   'L_FRIEND_PENDING' => $lang['New_friend_pending'],
   'L_COMMENT_PENDING' => $lang['New_comment_pending'],
   'INVITE_MORE' => '<a href="friends.php?mode=invite">Invite More Friends</a>',
   'SEARCH_F' => '<a href="friends_search.php">Search Friends</a>',
   'L_YES' => $lang['Yes'],
   'L_NO' => $lang['No'],
   'L_SUBMIT' => $lang['Submit'],
   'L_RESET' => $lang['Reset'],
   'S_FRIENDS_ACTION' => "friends.php" )
);

$template->pparse('body');

include($phpbb_root_path . 'includes/page_bottom.'.$phpEx);


redirect(append_sid("orioncp.$phpEx?mode=editprofile", true));

?>


I am using user_id but I think that it is not correct

thanks again

Added after 4 hours 1 minutes:

Hi Again

I managed to insert the javascript link that came with your mod and it works fine....

Thanks again
Found it
 
Beiträge: 5
Registriert: 24. Feb 2006 00:07

Beitragvon Fusione » 3. Nov 2006 09:31

Found it hat geschrieben:
Thanks for reading ...but after doing a search.. :oops: :oops:

I found the answer...sorry for wasting your time but thank you for a brilliant mod....

:D :D


Where did you find these instructions? I would also like to expand thepicture to other pages also.
Fusione
 
Beiträge: 13
Registriert: 15. Aug 2006 22:22

Beitragvon AmigaLink » 3. Nov 2006 12:09

Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon Fusione » 3. Nov 2006 22:40

Thank you.
I also have the problem of not getting the image to show up when trying to include the picture to the users Blog pages. I only get the default 'no image'.
I tried searching the topic but did not find an solution.

Found it - Could you please post the solutio you found. Thank you!
Fusione
 
Beiträge: 13
Registriert: 15. Aug 2006 22:22

Beitragvon AmigaLink » 4. Nov 2006 00:17

It ist the Posting #3/10 (my first in that topic). :)
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon Fusione » 8. Nov 2006 22:09

I'm trying to add the Userpic to the blog page of The blogmod.
I've added this to weblogs.php


Code: Alles auswählen
// <!-- BEGIN Userpic -->
        'PROFILEPIC' => '<a href="javascript:void(0)" onclick="window.open(\'profilepic.'.$phpEx.'?u='.$profiledata['user_id'].'&full\', \'_profilepic\', \'width='.($board_config['profilepic_width']+"20").',height='.($board_config['profilepic_height']+"30").',scrollbars=no,resizable=no\')"><img src="profilepic.'.$phpEx.'?u='.$profiledata['user_id'].'" border="0"></a>',
       'L_PROFILEPIC' => $lang['Profilepic'],
// <!-- END Userpic -->
   'POSTER_USERPIC' => ($poster_id != ANONYMOUS) ? '<img src="'.append_sid("profilepic.$phpEx?" . POST_USERS_URL . "=$poster_id").'" alt="'.$poster.'">' : '',


And I have also added this to the template:

Code: Alles auswählen
{POSTER_USERPIC}


I only get the default 'no image'.
Fusione
 
Beiträge: 13
Registriert: 15. Aug 2006 22:22

Beitragvon AmigaLink » 8. Nov 2006 22:38

The problem is $profiledata['user_id'] and contains the ID of the user, whose profile is indicated. This variable is only available in the usercp_profile.php.
You must find a equivalent variable wich is available in the weblogs.php. I don't now that MOD. Therefore I cannot help you there.
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

userpic part 2

Beitragvon plummer » 10. Dez 2006 20:11

Ok.....not sure why the other post got locked.......but from your response with the link......I am still unsure as to what code to use. Sorry, but could you expand a little on it please? I just need to know how to put that pic from the profile on another page. Thanks again.
plummer
 
Beiträge: 3
Registriert: 8. Dez 2006 21:51

Nächste

Zurück zu Userpic in Profile



Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast

cron