Seite 1 von 1

Möchte andere Profildaten in viewtopic.php anzeigen lassen.

Verfasst: 18.11.2007 12:51
von gnol
Ich habe schon im Template geschaut (Morpheus Template - viewtopic_body.tpl) aber komme nicht weiter.

Code: Alles auswählen

<?php

global $userdata, $board_config, $topic_id, $is_auth, $forum_topic_data, $lang, $phpEx;

if(!isset($can_reply))
{
	$can_reply = $userdata['session_logged_in'] ? true : false;
	if($can_reply)
	{
		$is_auth_type = 'auth_reply';
		if(!$is_auth[$is_auth_type])
		{
			$can_reply = false;
		}
		elseif ( ($forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED) && !$is_auth['auth_mod'] ) 
		{
			$can_reply = false;
		}
	}
	if($can_reply)
	{
		$this->assign_block_vars('xs_quick_reply', array());
	}
}

if($this->vars['TPL_HDR1_POST'])
{
	$postrow_count = ( isset($this->_tpldata['postrow.']) ) ?  sizeof($this->_tpldata['postrow.']) : 0;
	for ($postrow_i = 0; $postrow_i < $postrow_count; $postrow_i++)
	{
		$postrow_item = &$this->_tpldata['postrow.'][$postrow_i];
		// set profile link and search button
		if(!empty($postrow_item['PROFILE']) && strpos($postrow_item['POSTER_NAME'], '<') === false)
		{
			$postrow_item['SEARCH_IMG2'] = str_replace('%s', htmlspecialchars($postrow_item['POSTER_NAME']), $postrow_item['SEARCH_IMG']);
			$search = array($lang['Read_profile'], '<a ');
			$replace = array($postrow_item['POSTER_NAME'], '<a class="name" ');
			$postrow_item['POSTER_NAME'] = str_replace($search, $replace, $postrow_item['PROFILE']);
		}
		// check for new post
		$new_post = strpos($postrow_item['MINI_POST_IMG'], '_new') > 0 ? true : false;
		$postrow_item['TPL_HDR1'] = $new_post ? $this->vars['TPL_HDR1_NEW'] : $this->vars['TPL_HDR1_POST'];
	}	
	$old_hdr = $this->vars['TPL_HDR1_POST'];
	$this->vars['TPL_HDR1_POST'] = '';
}
?>
<!-- END switch_xs_enabled -->
<!-- BEGIN postrow -->
<a name="{postrow.U_POST_ID}"></a>
{TPL_HDR1_POST}{postrow.TPL_HDR1}{postrow.POST_SUBJECT}{TPL_HDR2}<table border="0" cellpadding="0" cellspacing="0" width="100%" class="post">
<tr>
	<td width="150" class="row" align="center" valign="top" style="padding: 2px;" rowspan="2">
		<div style="padding: 3px;"><span class="name">{postrow.POSTER_NAME}</span><br /></div>
		<div style="padding: 2px;"><span class="postdetails">{postrow.POSTER_RANK}</span><br /></div>
		{postrow.RANK_IMAGE}
		<div style="width: 140px; margin: auto; overflow: hidden">{postrow.POSTER_AVATAR}</div>
		<br />
		<table width="100%" cellspacing="5" cellpadding="0">
			<tr><td align="left"><span class="postdetails">{postrow.POSTER_JOINED}</span></td></tr>
			<tr><td align="left"><span class="postdetails">{postrow.POSTER_POSTS}</span></td></tr>
			<tr><td align="left"><span class="postdetails">{postrow.POSTER_FROM}</span></td></tr>
		</table>
Was muss ich dort ändern damit statt das Anmeldedatum, der Beruf angezeigt wird?

Verfasst: 18.11.2007 20:02
von manuj170793
musst du in der templates/subsilver/viewtopic_body.tpl machen. Dafür ist HTML vorrausgesetzt

Verfasst: 19.11.2007 22:00
von gnol
HTML kann ich ja.. auch einiges an PHP.. aber das hier ist ein anderer Style.. und ich möchte das mir statt das Anmeldedatum der Beruf aus der DB geholt wird.

Verfasst: 20.11.2007 09:09
von Seimon
gnol hat geschrieben:Was muss ich dort ändern damit statt das Anmeldedatum, der Beruf angezeigt wird?
Könnte so gehen:

Code: Alles auswählen

# 
#-----[ OPEN ]------------------------------------------ 
# 

viewtopic.php

# 
#-----[ FIND ]------------------------------------------ 
# 

$sql = "SELECT u.username,

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
# 


u.user_from

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

, u.user_occ

# 
#-----[ FIND ]------------------------------------------ 
# 

	$poster_joined = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Joined'] . ': ' . create_date($lang['DATE_FORMAT'], $postrow[$i]['user_regdate'], $board_config['board_timezone']) : '';

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 


	$poster_joined = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Occupation'] . ': ' . $postrow[$i]['user_occ'] : '';


Verfasst: 20.11.2007 12:07
von gnol
ahh ja stimmt! Ich depp guck in den Template-Dateien ^^

Werds mal ausprobieren.