Random User Block

Support for the IM Portal Project

Moderator: Integra Moderator

Random User Block

PostAuthor: Pogue Moran » Wed Feb 28, 2007 6:28 pm

Your phpBB Version: 2.0.22
phpBB Type: Integramod 141
MODs: Yes
Your knowledge: Basic Knowledge
Board URL: http://www.xbox360gamingworld.com/forum2

PHP Version:
MySQL Version:


What was done before the problem appeared?



What was done to try to solve the problem?




De.scription and Message

I found a random user block from Ezportal and have been trying to convert it over to IM Portal. I can get the language keys working but the data isn't coming out for some reason. Here is what I have in the blocks.

block_imp_random_user.php
Code: Select all
<?php/***************************************************************************  *                         blocks_imp_user_block.php  *                            -------------------  *   begin                : Saturday, March 20, 2004  *   copyright            : (C) 2004 masterdavid - Ronald John David  *   website              : [url=http://www.integramod.com]http://www.integramod.com[/url]  *   email                : <a>webmaster@integramod.com</a>  *  *   note: removing the original copyright is illegal even you have modified  *         the code.  Just append yours if you have modified it.  ***************************************************************************/  /***************************************************************************  *  *   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.  *  ***************************************************************************/  if ( !defined('IN_PHPBB') ){     die("Hacking attempt");}  if(!function_exists(imp_random_user_block_func)){         function imp_random_user_block_func()     {         global $userdata, $template, $board_config, $lang, $db, $phpEx;         global $agcm_color;       $sql = "SELECT *     FROM " . USERS_TABLE . "     WHERE user_active = '1'     AND user_id <ANONYMOUS>sql_query($sql)) )     {         message_die(GENERAL_ERROR, 'Could not query database for random user data.', '', __LINE__, __FILE__, $sql);     }     return ( $row = $db->sql_fetchrow($result) ) ? $row : false;  $profiledata = random_user(); $random_name = '<b><a>'. $profiledata['username']. '</a></b>'; $random_avatar = '';  if ( $profiledata['user_avatar_type'] && $user_id != ANONYMOUS && $profiledata['user_allowavatar'] ) {     switch( $profiledata['user_avatar_type'] ) { case USER_AVATAR_UPLOAD:     $random_avatar = ( $board_config['allow_avatar_upload'] ) ? '<img>' : '';     break; case USER_AVATAR_REMOTE:     $random_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img>' : '';     break; case USER_AVATAR_GALLERY:     $random_avatar = ( $board_config['allow_avatar_local'] ) ? '<img>' : '';     break;     } } // Shows default avatar, if no avatar else if ( empty($user_avatar) ) {     $random_avatar = '<img>'; }  $random_posts = $profiledata['user_posts']; $random_visits = $profiledata['user_totallogon']; $random_location = $profiledata['user_from'];  $www_img = ( !empty($profiledata['user_website'] ) ) ? '<a><img></a>' : '';$random_from_flag = ( !empty($profiledata['user_from_flag']) ) ? " <img>" : "";$random_age = $user_birthday = realdate($lang['DATE_FORMAT'], $profiledata['user_birthday']);  $random_temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=".$profiledata['user_id']."");$random_pm_img = '<a><img></a>';  $random_email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $profiledata['user_id']) : 'mailto:' . $profiledata['user_email'];$random_email_img = '<a><img></a>';$random_email = '<a>' . $lang['Send_email'] . '</a>';       if (($profiledata['user_session_time'] >= ( time() - 300 )) && ($profiledata['user_allow_viewonline']))     {         $on_off_hidden = '<img>';     }     else if (($profiledata['user_allow_viewonline']) == 0)     {         $on_off_hidden = '<img>';     }     else if ($profiledata['user_id'] == ANONYMOUS)     {         $on_off_hidden = '';     }     else     {         $on_off_hidden = '<img>';     }  // oc5iD End random user             $template->assign_vars(array(               'RANDOM_NAME' => $random_name,     'RANDOM_GENDER' => $random_gender,         'RANDOM_AGE' => $random_age,     'RANDOM_AVATAR' => $random_avatar,     'RANDOM_POSTS' => $random_posts,     'RANDOM_LAST_VISIT' => ($profiledata['user_level'] == ADMIN || (!$board_config['hidde_last_logon'] && $profiledata['user_allow_viewonline'])) ? (($profiledata['user_lastlogon'])? create_date($board_config['default_dateformat'], $profiledata['user_lastlogon'], $board_config['board_timezone']):$lang['Never_last_logon']):$lang['Hidde_last_logon'],     'RANDOM_VISITS' => $random_visits,     'RANDOM_JOINED' => create_date($lang['DATE_FORMAT'], $profiledata['user_regdate'], $board_config['board_timezone']),     'RANDOM_LOCATION' => $random_location,     'RANDOM_EMAIL_IMG' => $random_email_img,     'ON_OFF_HIDDEN' => $on_off_hidden,     'WWW' => $www,     'WWW_IMG' => $www_img,         'RANDOM_PM_IMG' => $random_pm_img,         'RANDOM_FROM_FLAG' => $random_from_flag,     'L_RANDOM_USER' => $lang['Random_user'],     'L_RANDOM_GENDER' => $lang['Random_Gender'],     'L_RANDOM_USER_EXPLAIN' => $lang['Random_user_explain'],     'L_RANDOM_USER_STATUS' => $lang['Random_user_status'],     'L_RANDOM_USER_CONTACT' => $lang['Random_user_contact'],         'L_POSTS' => $lang['Random_Posts'],         'L_JOINED' => $lang['Random_Joined'],         'L_LOCATION' => $lang['Random_Location'],         'L_WEBSITE' => $lang['Random_Website'],         'L_VISITS' => $lang['Random_Visits'],         'L_LAST_VISIT' => $lang['Last_Visited'],         'L_BIRTHDAY' => $lang['Random_birthday']             )         );     }}  imp_random_user_block_func();?>  


random_user_block.tpl

Code: Select all
<table><tr> <th>{L_RANDOM_USER}</th></tr>   <tr>     <td><span><center>{L_RANDOM_USER_EXPLAIN}<br>{RANDOM_NAME}<br>{RANDOM_AVATAR}</center><br>{L_RANDOM_USER_STATUS}: {ON_OFF_HIDDEN}<br>{L_RANDOM_USER_CONTACT}: {RANDOM_PM_IMG}{RANDOM_EMAIL_IMG}<br>{L_BIRTHDAY}: {RANDOM_AGE}<br>{L_POSTS}: {RANDOM_POSTS}<br>{L_JOINED}: {RANDOM_JOINED}<br>{L_WEBSITE}: {WWW_IMG}<br>{L_LOCATION}: {RANDOM_LOCATION} <br><br><center>{RANDOM_FROM_FLAG}</center><br>{L_VISITS}: {RANDOM_VISITS}<br>{L_LAST_VISIT}: {RANDOM_LAST_VISIT}</p></span></td>   </tr></table><br>


lang_random_user_block.php

Code: Select all
</b>


I tried changing the profiledata to userdata and it didnt work still any suggestions?
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: Random User Block

PostAuthor: Mayona » Sat Mar 10, 2007 9:04 pm

Hiya Pogue... could you send me the link to where you got it? I just wanna check what he did. I am already using random block since 2004 and just recently mod "the pic of the day mod" for IMPortal and also have a block that shows 9 random users in 3 rows.... pm me if you want to c it in action and will send you the link to my site- it's an adult oriented site so I really don't want it to link here.
Last edited by Mayona on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Mayona
Newbie
Newbie
 
Posts: 3
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 22, 2006 1:59 pm
Cash on hand: 0.00

Re: Random User Block

PostAuthor: Pogue Moran » Sat Mar 10, 2007 10:46 pm

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: Random User Block

PostAuthor: Mayona » Sun Mar 11, 2007 1:29 am

Please scheck if this one gonna work...
look for
Code: Select all
$profiledata = random_user();

change to
Code: Select all
$profiledata = imp_random_user_block_func();
Last edited by Mayona on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Mayona
Newbie
Newbie
 
Posts: 3
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 22, 2006 1:59 pm
Cash on hand: 0.00


Return to IM Portal Support Forum

Who is online

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