Seite 3 von 4

Verfasst: 14.03.2007 09:08
von Dr.Death
Hä ?

Du solltest die beiden Dateien ändern und zum Download bereitstellen.
Du musst die beiden Dateien ja nicht direkt einbauen.

Verfasst: 14.03.2007 18:41
von thompson
ich habe nun versucht das gleiche system für die viewforum.php und viewforum_body.tpl anzuwenden, aber hier geht es nicht. ich habe postrow auf topicrow abgeändert, damit ich hier ausblenden kann:

Code: Alles auswählen

<!-- BEGIN topicrow -->
	<tr>

	  <td class="row1" align="center" valign="middle" width="20"><img src="{topicrow.TOPIC_FOLDER_IMG}" width="19" height="18" alt="{topicrow.L_TOPIC_FOLDER_ALT}" title="{topicrow.L_TOPIC_FOLDER_ALT}" /></td>
	  
	  <td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_ATTACHMENT_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />
		{topicrow.GOTO_PAGE}</span></td>
	  <td class="row2" align="center" valign="middle"><span class="postdetails">{topicrow.REPLIES}</span></td>

	  <td class="row3" align="center" valign="middle"><span class="name">{topicrow.TOPIC_AUTHOR}</span></td>
	  <td class="row2" align="center" valign="middle"><span class="postdetails">{topicrow.VIEWS}</span></td>

	  <td class="row3Right" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">{topicrow.LAST_POST_TIME}<br />{topicrow.LAST_POST_AUTHOR} {topicrow.LAST_POST_IMG}</span></td>
	</tr>
	<!-- END topicrow -->
allerdings wird auch hier jetzt sowohl für den gast als auch für den geloggten ausgeblendet.

codepositionen habe ich in der viewforum.php verändert.

Verfasst: 15.03.2007 07:54
von Dr.Death
Moin,

hehe, das ist wiederum eine andere Geschichte ;-)

Was _genau_ möchtest du für Gäste ausblenden ?
Die ganzen Beiträge, oder nur die Grafiken ?

BTW: Das gehört jetzt ja schon in den Bereich MOD Support ....... :o

Verfasst: 15.03.2007 09:02
von thompson
die grafiken, die anzahl der posts, author.

so dass dort nur noch die spalten titel und beitrag stehen (evtl. anzahl der gelesenen)

mod ? :wink:

dachte der vorschlag mit dem switch wäre beliebig erweiter- und übertragbar. ;)

Verfasst: 15.03.2007 09:47
von Dr.Death
Das ganze ist nun ein "wenig" komplizierter.....

Als erstens: die genaue Position des "Switches":

viewforum.php

Suche:

Code: Alles auswählen

			'LAST_POST_IMG' => $last_post_url, 

			'L_TOPIC_FOLDER_ALT' => $folder_alt, 

			'U_VIEW_TOPIC' => $view_topic_url)
		);

DANACH einfügen:

Code: Alles auswählen

		
		if ( !$userdata['session_logged_in'] ) 
		{ 
			$template->assign_block_vars('topicrow.logged_in', array()); 
		}
		
Nun zum Template viewforum_body.tpl

Da sind nun die Überschrift und der Content in verschiedenen Switchen eingebunden ... o_O

Daher gilt:

Für die Überschrift den folgenden Switch verwenden:

Code: Alles auswählen

<!-- BEGIN switch_user_logged_in -->
Für den Content diesen hier:

Code: Alles auswählen

<!-- BEGIN logged_in -->
Der folgende Block wäre also etwas für Dich: ( Achtung, Code aus meiner Testumgebung... dient nur zur Veranschaulichung )

Code: Alles auswählen

	<tr> 
	  <th colspan="2" align="center" height="25" class="thCornerL" nowrap="nowrap">&nbsp;{L_TOPICS}&nbsp;</th>
	  <!-- BEGIN switch_user_logged_in --><th width="50" align="center" class="thTop" nowrap="nowrap">&nbsp;{L_REPLIES}&nbsp;</th><!-- END switch_user_logged_in -->
	  <!-- BEGIN switch_user_logged_in --><th width="100" align="center" class="thTop" nowrap="nowrap">&nbsp;{L_AUTHOR}&nbsp;</th><!-- END switch_user_logged_in -->
	  <th width="50" align="center" class="thTop" nowrap="nowrap">&nbsp;{L_VIEWS}&nbsp;</th>
	  <!-- BEGIN switch_user_logged_in --><th align="center" class="thCornerR" nowrap="nowrap">&nbsp;{L_LASTPOST}&nbsp;</th><!-- END switch_user_logged_in -->
	</tr>
	<!-- BEGIN topicrow -->
	<tr> 
	  <td class="row1" align="center" valign="middle" width="20"><!-- BEGIN logged_in --><img src="{topicrow.TOPIC_FOLDER_IMG}" width="19" height="18" alt="{topicrow.L_TOPIC_FOLDER_ALT}" title="{topicrow.L_TOPIC_FOLDER_ALT}" /><!-- END logged_in --></td>
	  <td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />
		{topicrow.GOTO_PAGE}</span></td>
	  <!-- BEGIN logged_in --><td class="row2" align="center" valign="middle"><span class="postdetails">{topicrow.REPLIES}</span></td><!-- END logged_in -->
	  <!-- BEGIN logged_in --><td class="row3" align="center" valign="middle"><span class="name">{topicrow.TOPIC_AUTHOR}</span></td><!-- END logged_in -->
	  <td class="row2" align="center" valign="middle"><span class="postdetails">{topicrow.VIEWS}</span></td>
	  <!-- BEGIN logged_in --><td class="row3Right" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">{topicrow.LAST_POST_TIME}<br />{topicrow.LAST_POST_AUTHOR} {topicrow.LAST_POST_IMG}</span></td><!-- END logged_in -->
	</tr>
	<!-- END topicrow -->
Erkennst Du nun das System ?

Verfasst: 15.03.2007 10:13
von thompson
danke, werde es testen.

das system hatte ich schon erkannt, aber der switch sass ja dann wohl an der falschen stelle. ;)

überschriften war kein problem, das hatte ich schon umgesetzt.

danke nochmal.

Verfasst: 15.03.2007 18:36
von thompson
hat alles wunderbar geklappt. danke.

kann man interessierten sicher als mini-mod anbieten.

sehr zu empfehlen.

Verfasst: 21.03.2007 08:04
von thompson
ich hab da noch ein problem mit einem verschachtelten switch:

Code: Alles auswählen

<!-- Custom Profile Fields MOD start --> 
<!-- BEGIN logged_in -->        
      <td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"> 
      
      <span class="name"><a name="{postrow.U_POST_ID}"></a><b><a href="javascript:emoticon('[b]{postrow.POSTER_NAME}[/b], ')">{postrow.POSTER_NAME}</a></b><br />{postrow.CARD_IMG}</span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_GENDER}<br /><a href="search.php?search_author={postrow.POSTER_NAME}" class="postdetails">{postrow.POSTER_POSTS}</a><br />{postrow.POSTER_FROM}<br />{postrow.POSTER_GEWICHT}<br />{postrow.POSTER_GROESSE}<br />{postrow.POSTER_ALTER} 
      <!-- BEGIN author_profile --> 
      <br />{postrow.author_profile.AUTHOR_VAL} 
     <!-- END author_profile --> 
      </span><br /> 
<!-- END logged_in -->      
      </td>    
<!-- Custom Profile Fields MOD finish --> 
der teil mit <!-- BEGIN author_profile --> <!-- END author_profile --> ist für die eingeloggten nicht mehr sichtbar. der rest davor und danach aber schon.

kann mir vielleicht noch jemand helfen ?

danke.

Verfasst: 22.03.2007 14:30
von thompson
ich vermute mal, dass das problem in der viewtopic.php liegt und zwar in folgendem bereich:

Code: Alles auswählen

//
  // Custom Profile Fields MOD
  //
  include_once($phpbb_root_path . 'includes/functions_profile_fields.'.$phpEx);
  $profile_data = get_fields('WHERE view_in_topic = ' . VIEW_IN_TOPIC . ' AND users_can_view = ' . ALLOW_VIEW);
  $profile_names = array();
  
  $aboves = array();
  $belows = array();
  $author = array();
  foreach($profile_data as $field)
  {
    $name = $field['field_name'];
    $col_name = text_to_column($field['field_name']);
    $id = $poster_id;
    $type = $field['field_type'];
    $location = $field['topic_location'];
    
    $sql2 = "SELECT $col_name FROM " . USERS_TABLE . "
      WHERE user_id = $id";
    if(!($result2 = $db->sql_query($sql2)))
      message_die(GENERAL_ERROR,'Could not obtain field value','',__LINE__,__FILE__,$sql2);
    
    $temp = $db->sql_fetchrow($result2);
    $profile_names[$name] = displayable_field_data($temp[$col_name],$field['field_type'],$field['linkify']);
    
    if (($profile_names[$name] != '') || (!$board_config['collapse_fields'])) {
    if($location == AUTHOR)
      $author[] = $name . ': ' . $profile_names[$name];
    elseif($location == ABOVE_SIGNATURE)
      $aboves[] = $name . ': ' . $profile_names[$name];
  	else
  	  $belows[] = $name . ': ' . $profile_names[$name];
  	  }
  }
  
  foreach($aboves as $above_val)
    $template->assign_block_vars('postrow.above_sig',array('ABOVE_VAL' => $above_val));
  foreach($belows as $below_val)
    $template->assign_block_vars('postrow.below_sig',array('BELOW_VAL' => $below_val));
  foreach($author as $author_val)
    $template->assign_block_vars('postrow.author_profile',array('AUTHOR_VAL' => $author_val));
  //
  // END Custom Profile Fields MOD
  //
ich hab einen neuen switch gemacht:

Code: Alles auswählen

if ( $userdata['session_logged_in'] ) 
{ 
$template->assign_block_vars('postrow.author_profile.logged_in', array()); 
}
und diesen an den verschiedensten stellen eingebaut, aber ohne erfolg.

es wird für eingeloggte einfach nicht eingeblendet. kann sich das bitte jemand mal anschauen ?

herzlichen dank.

Verfasst: 24.03.2007 19:26
von thompson
*bump*
wäre echt wichtig für mich.