Seite 1 von 1
Zufälliges Profil auf index anzeigen
Verfasst: 04.09.2005 01:23
von me_reflex
Hi,
suche ne Mod / Snippet mit der ich auf dem index einen zufälligen User
(mit Avatar!) im Bereich "Wer ist online?" anzeigen lassen kann.
MfG
Chris
Verfasst: 04.09.2005 02:59
von Firestarter
Code: Alles auswählen
########################################################################################################
## MOD Title: Random User (On Forum Index)
## MOD Author: AbelaJohnB < abela@johnabela.com > (John B. Abela) http://www.johnabela.com/
## MOD Description: This MOD will add a random user to your forum index, directly below
## the 'newest member section.
## MOD Version: 1.0.3
##
## Installation Level: Easy
## Installation Time: ~5 Minutes
## Files To Edit:
## index.php
## templates/subSilver/index_body.tpl
## langauge/lang_english/lang_main.php
## Included Files:
## N/A
########################################################################################################
## Author Notes:
## Copyright © John B. Abela, < abela@johnabela.com >
##
## I do not support my MOD's anywhere except at http://www.johnabela.com/mods/ so please
## visit there for support. If you intend to take my work and modify it, you must retain my above
## Copyright within any install file. This does not mean you have to ask me to -use- this MOD,
## but that does mean you cannot -distribute- this MOD, in modified or non-modified format,
## without my copyright left intact. Contact me at: abela@johnabela.com - www.JohnAbela.Com
##
## This MOD, like all phpBB MOD's, is released under the GNU/GPL License. A copy of this license
## should have been included with the distribution package that included this install.txt file.
## If it was not, chances are you are using a version of this MOD that very likely has been edited
## by someone other than myself, and thus, perhaps, a greater security risk to you.
##
## Possible Future Plans: None
##
## ~ John B. Abela - (aka: AbelaJohnB) http://www.johnabela.com/mods/ - abela@johnabela.com
## Stop By And Say Hello If You Feel Like It :)
## I maintain a "Mailing Group" for email notification of any new/updated MOD's. Just stop by my
## forum, register, than join the Group within the Usersgroup section of my MOD Forums!
########################################################################################################
## MOD History:
##
## 2005-01-04 - Version 1.0.3
## - Updated For phpBB 2.0.11
##
## 2003-06-17 - Version 1.0.2
## - Updated for phpBB 2.0.5
##
## 2003-01-01 - Version 1.0.1
## - Rewrote for phpBB2.0.4+
##
## 2002-12-01 - Version 1.0.0
## - Initial Release
########################################################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
########################################################################################################
#
#-----[ OPEN ]-------------------------------------
#
index.php
#
#-----[ FIND ]-------------------------------------
#
$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
#
#-----[ AFTER, ADD ]-------------------------------------
#
//
// MOD START- RANDOM USER MOD - AbelaJohnB
//
function random_user()
{
global $db;
//
$sql = "SELECT user_id, username
FROM " . USERS_TABLE . "
WHERE user_active = '1'
AND user_id <> " . ANONYMOUS . "
ORDER BY RAND() LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query random user data.', '', __LINE__, __FILE__, $sql);
}
return ( $row = $db->sql_fetchrow($result) ) ? $row : false;
}
$profiledata = random_user();
$random_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=".$profiledata['user_id']."") . '">'. $profiledata['username']. '</a>';
//
// MOD END - RANDOM USER MOD - AbelaJohnB
//
#
#-----[ FIND ]-------------------------------------
#
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
#
#-----[ BEFORE, ADD ]-------------------------------------
#
//
// MOD START - RANDOM USER MOD - AbelaJohnB
//
'L_RANDOM_USER' => $lang['Random_user'],
'RANDOM_USER_LINK' => $random_link,
//
// MOD END - RANDOM USER MOD - AbelaJohnB
//
#
#-----[ OPEN ]-------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]-------------------------------------
#
<td class="row1" align="left" width="100%">
#
#-----[ IN-LINE FIND ]-------------------------------------
#
{NEWEST_USER}
#
#-----[ IN-LINE AFTER, ADD ]-------------------------------------
#
<br />{L_RANDOM_USER} {RANDOM_USER_LINK}<BR />
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Newest_user'] = 'The newest registered user is <b>%s%s%s</b>'; // a href, username, /a
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// MOD START- RANDOM USER MOD - AbelaJohnB
//
$lang['Random_user'] = 'A random user is: ';
//
// MOD END - RANDOM USER MOD - AbelaJohnB
//
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
oder das hier für das Portal entsprechend verändern :
Code: Alles auswählen
##############################################################
## MOD Title: Random User Portal Block
## MOD Version: 1.0
## Author: oc5iD
## Email: admin@on-irc.net
## Support: http://www.on-irc.net
## Demo: http://www.on-irc.net/portal.php
##
## Description: Places a block on your portal, that displays a random
## user each time the page is loaded, with users info
## including, Name, Birthday, Posts, Location, Last Visit,
## Avatar & Flag.
##
## Installation Level: easy
## Installation Time: 5 - 10 minutes
## Files To Edit (3): portal.php
## /language/lang_english/lang_main.php
## /templates/xxx/portal_body.tpl
##
##
## Included Files (2) /random_user_install.txt
## /templates/xxx/images/lang_english/default_avatar.gif
##
##############################################################
Verfasst: 04.09.2005 10:34
von me_reflex
Moin,
also das obere hab ich zurzeit schon bei mir installiert.
Wo finde ich denn den download zur unteren Mod?
Ich denke, dass das das ist was ich suche

(cooler Satz ^^)
MfG
Chris
Verfasst: 04.09.2005 16:42
von Firestarter