Vor einiger Zeit habe ich den MOD Random User on Index (von J. B. Abela) installiert. Funktioniert sehr gut soweit (siehe http://www.manual-forum.de rechts, unter dem Shop).
Jetzt möchte ich ihn aber erweitern:
Ich möchte anzeigen:
Avatar (falls vorhanden)
Nickname
Sig (falls vorhanden)
Eine andere Erweiterung die ich für sinnvoll(er) halten würde, wäre
Profilphoto (falls vorhanden)
Nickname
Sig (falls vorhanden)
Das Profilfoto könnte aus Acyd Burns MOD "Profile Photo Mod" kommen.
Ich habe beides installiert und möchte es nun kombinieren.
Könnte mir jemand dabei helfen?
Danke!
Gruss
Holger
Hier der Code für Random User on Index (weiter unten habe ich Acyds MOD eingefügt):
Code: Alles auswählen
##########################################################################################
## MOD Title: Random User (On Forum Index)
## MOD Author: AbelaJohnB <abela@phpbb.com> (John B. Abela) http://www.johnabela.com/mods/
## MOD Description: This MOD will add a random user to your forum index.
## MOD Version: 1.0.1
##
## Installation Level: Advanced
## Installation Time: ~5 Minutes
## Files To Edit: 3
## index.php
## templates/subSilver/index_body.tpl
## langauge/lang_english/lang_main.php
##
## Included Files: none
##########################################################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious
## code to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not
## offered in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##########################################################################################
##Author Notes:
##
## Copyright © John B. Abela. 2002-2003 - http://www.JohnAbela.Com/
##
## ** No Placement Of This MOD, in any form, At Sites Other Than www.phpBB.Com Or www.JohnAbela.Com Without My Permission.
##
## If you download this MOD from anywhere other than my own site or phpBB, please do not
## use it. I do not allow this MOD (or any of mine) to be posted at non-official phpBB Sites,
## and as such I will not be able to keep this MOD up-to-date at any of these non-official sites
## which do not respect my request to not place it within their site. If you do find it at a site
## other than phpBB.com please let me know! <abela@phpbb.com>
##
## If you are an owner of a non-official site and would like to place it within your site, please
## email me for permission, so I can keep track of who has it and where it's at, to help keep
## keep your site up-to-date with this MOD.
##
## For anybody that likes this MOD, you can always say 'thanks' by signing my guestbook at
## my web site! http://www.JohnAbela.Com/ :)
##
##########################################################################################
## MOD History:
##
## 1.0.1 - 1/1/2003 - Updated for phpBB2.0.4
## 1.0.0 - 12/1/2002 - 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 - 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 - RANDOM USER MOD - AbelaJohnB
#
#-----[ FIND ]-------------------------------------
#
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
#
#-----[ BEFORE, ADD ]-------------------------------------
#
// MOD - RANDOM USER MOD - AbelaJohnB
'L_RANDOM_USER' => $lang['Random_user'],
'RANDOM_USER_LINK' => $random_link,
// MOD - RANDOM USER MOD - AbelaJohnB
#
#-----[ OPEN ]-------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ 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 - RANDOM USER MOD - AbelaJohnB
$lang['Random_user'] = 'A random user is: ';
// MOD - RANDOM USER MOD - AbelaJohnB
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoMCode: Alles auswählen
#############################################################################
## Mod Title: Profile Photo Mod
## Mod Version: 2.0.2
## Author: Acyd Burn < acyd.burn@gmx.de > - Meik Sievertsen - http://www.opentools.de/
##
## Description:
## This Mod adds the ability to let your users attach photos to their profile.
##
## Revision History:
##
## 2002-06-02 - Version 2.0.2
## - made phpBB 2.0.x compatible
##
## 2002-03-21 - Version 2.0.1
## - complete rewrite of this mod for rc-4. :)
## - bugfixes
##
## 2002-03-07 - initial version 2.0.0
##
## Installation Level: intermediate
## Installation Time: 5-10 Minutes
## Files To Edit: profile.php, admin/admin_board.php, includes/usercp_register.php,
## templates/subSilver/profile_add_body.tpl, templates/subSilver/profile_view_body.tpl,
## templates/subSilver/admin/board_config_body.tpl
## Included Files: 3 (+1 temporary file for installation)
##
#############################################################################
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
#############################################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
#############################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#############################################################################
##
## Author Note:
##
## This Mod adds some rows to the users table and to the config table
##
## At the moment, english, german and french are supported. If the Mod can not
## find the appropiate language file, english is used by default.
##
##
#############################################################################
#
# First of all, copy all files to their respective location
#
# These are:
# /profilephoto_mod.php
# /mod_table_inst.php (you can delete it after installation)
#
# /templates/subSilver/profile_photo_box.tpl
#
# /language/lang_XX/lang_profilephoto.php
#
Now we want to create the rows in the database, therefore we execute mod_table_inst.php (http://www.yoursite.com/phpBB2/mod_table_inst.php)
Contact me if you have questions about this.
Now you have to alter existing files, read the instructions carefully and make sure you find all lines.
#
# Changes to already existing files
#
#
#-----[ OPEN ]---------------------------------------------
#
./profile.php
#
#-----[ FIND ]---------------------------------------------
#
include($phpbb_root_path . 'common.'.$phpEx);
#
#-----[ AFTER, ADD ]---------------------------------------
#
include($phpbb_root_path . 'profilephoto_mod.'.$phpEx);
#
#-----[ FIND ]---------------------------------------------
#
// End page specific functions
// ---------------------------
#
#-----[ AFTER, ADD ]---------------------------------------
#
$profilephoto_mod->execute_mod();
#
#-----[ OPEN ]---------------------------------------------
#
./admin/admin_board.php
#
#-----[ FIND ]---------------------------------------------
#
$template->set_filenames(array(
"body" => "admin/board_config_body.tpl")
);
#
#-----[ AFTER, ADD ]---------------------------------------
#
//
// Profile Photo Mod
//
if ( !file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_profilephoto.'.$phpEx) )
{
include($phpbb_root_path . 'language/lang_english/lang_profilephoto.'.$phpEx);
}
else
{
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_profilephoto.' . $phpEx);
}
$photo_remote_yes = ( $new['allow_photo_remote'] ) ? 'checked="checked"' : '';
$photo_remote_no = ( !$new['allow_photo_remote'] ) ? 'checked="checked"' : '';
$photo_upload_yes = ( $new['allow_photo_upload'] ) ? 'checked="checked"' : '';
$photo_upload_no = ( !$new['allow_photo_upload'] ) ? 'checked="checked"' : '';
$template->assign_vars(array(
'L_PROFLE_PHOTO_SETTINGS' => $lang['Profile_photo_settings'],
'L_ALLOW_PHOTO_REMOTE' => $lang['Allow_photo_remote'],
'L_ALLOW_PHOTO_REMOTE_EXPLAIN' => $lang['Allow_photo_remote_explain'],
'L_ALLOW_PHOTO_UPLOAD' => $lang['Allow_photo_upload'],
'L_PHOTO_MAX_FILESIZE' => $lang['Photo_max_filesize'],
'L_PHOTO_MAX_FILESIZE_EXPLAIN' => $lang['Photo_max_filesize_explain'],
'L_MAX_PHOTO_SIZE' => $lang['Max_photo_size'],
'L_PHOTO_STORAGE_PATH' => $lang['Photo_storage_path'],
'L_PHOTO_STORAGE_PATH_EXPLAIN' => $lang['Photo_storage_path_explain'],
'PHOTO_REMOTE_YES' => $photo_remote_yes,
'PHOTO_REMOTE_NO' => $photo_remote_no,
'PHOTO_UPLOAD_YES' => $photo_upload_yes,
'PHOTO_UPLOAD_NO' => $photo_upload_no,
'PHOTO_FILESIZE' => $new['photo_filesize'],
'PHOTO_MAX_HEIGHT' => $new['photo_max_height'],
'PHOTO_MAX_WIDTH' => $new['photo_max_width'],
'PHOTO_PATH' => $new['photo_path'])
);
#
#-----[ OPEN ]---------------------------------------------
#
./includes/usercp_register.php
#
#-----[ FIND ]---------------------------------------------
#
$error = FALSE;
#
#-----[ REPLACE WITH ]-------------------------------------
#
// $error = FALSE;
#
#-----[ FIND ]---------------------------------------------
#
message_die(GENERAL_ERROR, 'Could not insert data into users table', '', __LINE__, __FILE__, $sql);
}
#
#-----[ AFTER, ADD ]---------------------------------------
#
$profilephoto_mod->photo_insert($mode);
#
#-----[ OPEN ]---------------------------------------------
#
./templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]---------------------------------------------
#
<input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" />
#
#-----[ REPLACE WITH ]-------------------------------------
#
<!--<input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" />-->
#
#-----[ FIND ]---------------------------------------------
#
<!-- END switch_avatar_block -->
#
#-----[ AFTER, ADD ]---------------------------------------
#
{PHOTO_BOX}
#
#-----[ OPEN ]---------------------------------------------
#
./templates/subSilver/profile_view_body.tpl
#
#-----[ FIND ]---------------------------------------------
#
//--></script><noscript>{ICQ_IMG}</noscript></td>
</tr>
</table>
</td>
</tr>
#
#-----[ AFTER, ADD ]---------------------------------------
#
<tr>
<td class="catLeft" align="center" width="40%" height="28" colspan="2"><b><span class="gen">{L_PHOTO}</span></b></td>
<tr>
<td align="center" colspan="2" class="row1">{PHOTO_IMG}</td>
</tr>
#
#-----[ OPEN ]---------------------------------------------
#
./templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]---------------------------------------------
#
<td class="row2"><input type="text" size="20" maxlength="255" name="avatar_gallery_path" value="{AVATAR_GALLERY_PATH}" /></td>
</tr>
#
#-----[ AFTER, ADD ]---------------------------------------
#
<tr>
<th class="thHead" colspan="2">{L_PROFLE_PHOTO_SETTINGS}</th>
</tr>
<tr>
<td class="row1">{L_ALLOW_PHOTO_REMOTE} <br /><span class="gensmall">{L_ALLOW_PHOTO_REMOTE_EXPLAIN}</span></td>
<td class="row2"><input type="radio" name="allow_photo_remote" value="1" {PHOTO_REMOTE_YES} /> {L_YES}&&<input type="radio" name="allow_photo_remote" value="0" {PHOTO_REMOTE_NO} /> {L_NO}</td>
</tr>
<tr>
<td class="row1">{L_ALLOW_PHOTO_UPLOAD}</td>
<td class="row2"><input type="radio" name="allow_photo_upload" value="1" {PHOTO_UPLOAD_YES} /> {L_YES}&&<input type="radio" name="allow_photo_upload" value="0" {PHOTO_UPLOAD_NO} /> {L_NO}</td>
</tr>
<tr>
<td class="row1">{L_PHOTO_MAX_FILESIZE}<br /><span class="gensmall">{L_PHOTO_MAX_FILESIZE_EXPLAIN}</span></td>
<td class="row2"><input type="text" size="4" maxlength="10" name="photo_filesize" value="{PHOTO_FILESIZE}" /> Bytes</td>
</tr>
<tr>
<td class="row1">{L_MAX_PHOTO_SIZE} <br />
<span class="gensmall">{L_MAX_AVATAR_SIZE_EXPLAIN}</span>
</td>
<td class="row2"><input type="text" size="3" maxlength="4" name="photo_max_height" value="{PHOTO_MAX_HEIGHT}" /> x <input type="text" size="3" maxlength="4" name="photo_max_width" value="{PHOTO_MAX_WIDTH}"></td>
</tr>
<tr>
<td class="row1">{L_PHOTO_STORAGE_PATH} <br /><span class="gensmall">{L_PHOTO_STORAGE_PATH_EXPLAIN}</span></td>
<td class="row2"><input type="text" size="20" maxlength="255" name="photo_path" value="{PHOTO_PATH}" /></td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
You'll have to create the directory for your photos (like the avatar directory) and chmod
it to 777 (or change the owner to you httpd-servers owner) to upload photos.
if you have only plain ftp-access change the 'Attribute' of your photo-directory to rwxrwxrwx.
the default path is 'images/photos'.
# EoM