Pagina 1 van 1

MOD Title: Avatar on index

Geplaatst: 26 sep 2005, 19:02
door lifeguard
http://www.brocoteam.nl/brocoforum

dan onderaan!!


wat doe ik fout??


oja hier de MOD

Code: Selecteer alles

##############################################################
## MOD Title: Avatar on index
## MOD Author: RedFoxy < redfoxy@redfoxy.it > (Massimo Ciccio') http://www.redfoxy.it/
## MOD Description: Insert user avatar (with link to search about last message recived),
##                  user name (with link to user's profile) and last message recived on
##                  index page near who is online table box.
##                  Very usefully!
##
## MOD Version: 1.2.0
##
## EasyMod: Tested with 0.1.13
##
## Installation Level: Easy
## Installation Time: 1 Minutes
## Files To Edit:
##         index.php
##         templates/subSilver/index_body.tpl 
##
## Included Files:
##
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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/ 
##############################################################
## Author Notes:
## That's my first release of that MOD, just to remember what I've do...
## I have tested this MOD whit phpBB 2.0.4/2.0.6/2.0.10 with MySQL Database 3.23.56/4.0.16
##
## Future versions can be found at http://www.redfoxy.it
## I've set up a support forum for my mods at http://www.forum.redfoxy.com (it's an
## italian forum but you can post in english without problems.
##
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
## Copyright:      (C) 2004 Avatar on index 1.2.0 - RedFoxy
##
##############################################################
## MOD History:
##
##   2004-11-08 - Version 1.2.0
##   - Add link to search about last message recived
##   - Changed support to user's message and profile
##   - Draw tpl again
##   - EasyMod 0.1.13 compliant
##
##   2004-11-05 - Version 1.0.1
##   - Typo corrected
##   - Add link to edit profile
##   - Draw new tpl
##
##   2004-11-03 - Version 1.0.0
##   - First release
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
#
#-----[ OPEN ]----------------------------------------------------------
#
index.php
#
#-----[ FIND ]----------------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]----------------------------------------------------
#
//-- mod : Avatar on index -------------------------------------------------------------------------
#
#-----[ FIND ]----------------------------------------------------------
#
	$template->set_filenames(array(
		'body' => 'index_body.tpl')
	);
#
#-----[ BEFORE, ADD ]---------------------------------------------------
#
//-- mod : Avatar on index -------------------------------------------------------------------------
//-- add
	if( $userdata['session_logged_in'] )
	{
		$sql = "SELECT u.user_avatar, u.user_avatar_type, u.user_id, u.user_allowavatar, u.username
			FROM " . USERS_TABLE . " u
			WHERE u.user_id = " . $userdata['user_id'] ;
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not query user information', '', __LINE__, __FILE__, $sql);
		}
			$avatarrow = $db->sql_fetchrow($result);

		if ( $avatarrow['user_avatar_type'] && $userdata['user_id'] != ANONYMOUS && $avatarrow['user_allowavatar'] )
		{
			switch( $avatarrow['user_avatar_type'] )
			{
				case USER_AVATAR_UPLOAD:
					$user_avatar = ( $board_config['allow_avatar_upload'] ) ? $board_config['avatar_path'] . '/' . $avatarrow['user_avatar'] : '';
					break;
				case USER_AVATAR_REMOTE:
					$user_avatar = ( $board_config['allow_avatar_remote'] ) ? $avatarrow['user_avatar'] : '';
					break;
				case USER_AVATAR_GALLERY:
					$user_avatar = ( $board_config['allow_avatar_local'] ) ? $board_config['avatar_gallery_path'] . '/' . $avatarrow['user_avatar'] : '';
					break;
			}
			$user_avatar = '<a href="' . append_sid('search.'.$phpEx.'?search_id=egosearch') .
					'"><img src="' . $user_avatar . '" alt="' . $avatarrow['username'] . '" border="0" /></a><br>';
		}
		$user_name = '<a href="' . append_sid('profile.'.$phpEx.'?mode=editprofile') .
				'"><b>' . $avatarrow['username'] . '</b></a>';

		$sql = "SELECT COUNT(post_id) as tot
			FROM " . POSTS_TABLE . "
			WHERE post_time >= " . $userdata['user_lastvisit'] . "
			AND poster_id != " . $userdata['user_id'];

		$result = $db->sql_query($sql);

		if( $result )
		{
			$row = $db->sql_fetchrow($result);
			$user_newposts = '<a href="' . append_sid('search.'.$phpEx.'?search_id=newposts') .
						'" class="gensmall">' . $lang['Search_new'] . ' (' . $row['tot'] .')</a>';
		}
	}
	else
	{
		$user_avatar = '';
	}
//-- end : Avatar on index -------------------------------------------------------------------------

#
#-----[ FIND ]----------------------------------------------------------
#
                'FORUM_LOCKED_IMG' => $images['forum_locked'],
#
#-----[ AFTER, ADD ]----------------------------------------------------
#

//-- mod : Avatar on index -------------------------------------------------------------------------
//-- add
		'USER_AVATAR' => $user_avatar,
		'USER_NAME' => $user_name,
		'USER_NEWPOSTS' => $user_newposts,
//-- end : Avatar on index -------------------------------------------------------------------------
#
#-----[ OPEN ]----------------------------------------------------------
#
templates/subSilver/index_body.tpl 
#
#-----[ FIND ]----------------------------------------------------------
#
#
<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
#
#-----[ BEFORE, ADD ]---------------------------------------------------
#
<!-- mod : Avatar on index -->
#
#-----[ FIND ]----------------------------------------------------------
#
	<td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
#
#-----[ REPLACE WITH ]--------------------------------------------------
#
	<td class="row1" align="center" valign="middle" rowspan="2">{USER_AVATAR}
	<span class="genmed">{USER_NAME}</b></span><br>
	<span class="gensmall">{USER_NEWPOSTS}</span></td>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

Geplaatst: 26 sep 2005, 19:12
door Paul
de rowspan in index_body.tpl niet goed aanpgeast ;)

Geplaatst: 26 sep 2005, 19:36
door lifeguard
wat zou hier veranderd moeten worden dan?

Code: Selecteer alles

{SHOUTBOX_BODY}
<!-- mod : Avatar on index -->
 </table>
<table width="780" cellspacing="0" cellpadding="2" border="0" align="center">
  <tr> 
	<td align="left" valign="bottom"><span class="gensmall">
	<!-- BEGIN switch_user_logged_in -->
	{LAST_VISIT_DATE}<br />
	<!-- END switch_user_logged_in -->
	{CURRENT_TIME}<br /></span><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></span></td>
	<td align="right" valign="bottom" class="gensmall">
		<!-- BEGIN switch_user_logged_in -->
		<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />
		<!-- END switch_user_logged_in -->
		<a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a></td>
  </tr>
</table>
<!-- Top Topics on Index 1.1.0 - Begin Code Addition -->
<table width="62%" cellpadding="2" cellspacing="1" border="0" class="forumline" align="center">
  <tr> 
	<th width="25%" class="thTop" nowrap="nowrap">&nbsp;{L_TOPICSRECENT}&nbsp;</th>
	<th width="38%" colspan="2" class="thTop" nowrap="nowrap">&nbsp;{L_TOPICSPOPULAR}&nbsp;</th>
	<th width="37%" colspan="2" class="thTop" nowrap="nowrap">&nbsp;{L_TOPICSPOPULARVIEW}&nbsp;</th>
  </tr>
  <!-- BEGIN topicrecentpopular -->
  <tr> 
	<td width="29%" class="row2" align="left" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSRECENT}</span></td>
	<td width="31%" class="row2" align="left" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSPOPULAR}</span></td>
	<td width="6%" class="row2" align="center" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSPOPULARC}</span></td>
	<td width="29%" class="row2" align="left" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSPOPULARVIEW}</span></td>
	<td width="6%" class="row2" align="center" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSPOPULARVIEWC}</span></td>
  </tr>
  <!-- END topicrecentpopular -->
</table>
<!-- Top Topics on Index 1.1.0 - End Code Addition -->
<table width="780" cellpadding="2" cellspacing="1" border="0" class="forumline" align="center">
  <tr> 
	<th colspan="2" class="thCornerL" height="25" nowrap>&nbsp;{L_FORUM}&nbsp;</th>
	<th width="50" class="thTop" nowrap>&nbsp;{L_TOPICS}&nbsp;</th>
	<th width="50" class="thTop" nowrap>&nbsp;{L_POSTS}&nbsp;</th>
	<th class="thCornerR" nowrap>&nbsp;{L_LASTPOST}&nbsp;</th>
  </tr>
  <!-- BEGIN catrow -->
  <tr> 
	<td class="catLeft" colspan="5" height="28"><span class="cattitle"><a href="{catrow.U_VIEWCAT}" class="cattitle">{catrow.CAT_DESC}</a></span></td>	

Geplaatst: 26 sep 2005, 19:54
door lifeguard
ik heb em opnieuw gedaan, maar weer t zelfde

Geplaatst: 26 sep 2005, 20:29
door Diablo Gamer
klink stom maar heb je het ook in je marvel gedaan

Geplaatst: 26 sep 2005, 21:34
door Tuningstyle
je hebt je lijnen verkeerd genummerd denk ik

Had ik ook
Kijken in je index_body naar die lijn voor die avatar op index en ergens op 7 zetten
Toen lukte het bij me :P

Geplaatst: 28 sep 2005, 17:25
door lifeguard
Blijft hetzelfde :(


zal ik anders de status van mn index_body is laten zien?? misschien zien jullie wat fout is

edit: http://www.brocoteam.nl/dump/index_body.txt

Geplaatst: 28 sep 2005, 18:00
door lifeguard
Tuningstyle schreef:je hebt je lijnen verkeerd genummerd denk ik

Had ik ook
Kijken in je index_body naar die lijn voor die avatar op index en ergens op 7 zetten
Toen lukte het bij me :P
ik zie geen nummers staan hoor :)

mijn ftp opent em automatisch in dreamweaver ...

Geplaatst: 28 sep 2005, 18:43
door lifeguard
Anyone?? :(

Geplaatst: 28 sep 2005, 18:46
door cdrom-la
ik heb NIET naar je code gekeken
maart zet eens e rowspan op 5 in index_body.tpl

Geplaatst: 28 sep 2005, 18:49
door lifeguard
cdrom-la schreef:ik heb NIET naar je code gekeken
maart zet eens e rowspan op 5 in index_body.tpl
en dat is :$

Geplaatst: 28 sep 2005, 19:11
door Bee
cdrom-la schreef:ik heb NIET naar je code gekeken
maart zet eens e rowspan op 5 in index_body.tpl
Vier bedoel je.

@lifeguard: Het stuk waar cdrom-la op doelt heb je niet gepost.

Geplaatst: 28 sep 2005, 19:37
door lifeguard
welk stuk moet ik dan neer zetten Bee???

Geplaatst: 28 sep 2005, 19:46
door Bee
het stuk van who is online moet je aanpassen. Pas als je er niet uitkomt posten.

Geplaatst: 28 sep 2005, 20:05
door lifeguard
bij deze dus ......... :roll:

weer veranderd, maar blijf dat blauwe vak houden

Geplaatst: 29 sep 2005, 12:19
door lifeguard
ik hou het voor gezien, ik naai di ehele hack er wel uit, want wat ik ook doe..............het blijft