Seite 2 von 5

Verfasst: 16.08.2004 21:35
von Leuchte
viewforum.php
Suche

Code: Alles auswählen

}

	$topics_count -= $total_announcements;

	$template->assign_vars(array(
Füge davor ein

Code: Alles auswählen

if ( $userdata['user_level'] == MOD ) 
{ 
  $template->assign_block_vars('topicrow.switch_mod',   array()); 
}
In der viewforum_body.tpl dann wieder

Code: Alles auswählen

<!-- BEGIN switch_mod --> 
.
.
.
<!-- END switch_mod -->

;-)

Verfasst: 16.08.2004 21:57
von bedee
cool

jetzt schreib

Verfasst: 18.08.2004 11:02
von bedee
... ich bald ein eigenes tutorial daraus:

selbes prob, nun aber in der viewtopic_body.tpl
dort gibts den switch

Code: Alles auswählen

<!-- BEGIN postrow -->
...also, brauch ich woll einen switch wie folgender:

Code: Alles auswählen

if ( $userdata['user_level'] == MOD ) 
{ 
  $template->assign_block_vars('postrow.switch_mod',   array()); 
}
den muss ich wohl in die viewtopic.php setzen,
(langsam schein ichs zu kapieren...)
aber - wohin?

besten dank - sagt mir wenn ich nerve
(aber vielleicht helf ich mit meiner nachbohrerei auch anderen usern :wink: )

bedee

Verfasst: 18.08.2004 12:44
von Leuchte
Setz es mal vor

Code: Alles auswählen

}

$template->pparse('body');

passt

Verfasst: 19.08.2004 11:06
von bedee
grosses *freu*
danke
lg
bedee

Verfasst: 04.09.2004 07:30
von D@ve
Jetzt hab ich aber auch mal eine Frage... Warum funktioniert das nicht??

Code: Alles auswählen

//
// Topic location toggle selection
//
if ($mode == 'newtopic' || ( $mode == 'editpost' && $post_info['topic_location_enable'] && $post_data['first_post']))
{
        $template->assign_vars(array(
                'ZIP' => $zip,
                'CITY' => $city,
                'L_ZIP' => $lang['ZIP'],
                'L_CITY' => $lang['City'])
        );


        // check if map_mod is installed
        $map_mod_installed = ( (defined("MAP_MOD_MAP_TABLE") && defined("MAP_MOD_CONFIG_TABLE") ) ) ? true : false;

        if ($map_mod_installed)
        {
            $template->assign_vars(array(
                    'L_FIND_PLACE' => $lang['map_find_place'],
                    'U_FIND_PLACE' => append_sid("map_search.$phpEx"),
                    'LONGITUDE' => $longitude,
                    'LATITUDE' => $latitude,
                    'L_LONGITUDE' => $lang['Longitude'],
                    'L_LATITUDE' => $lang['Latitude'])
            );

            $template->assign_block_vars('switch_map_mod_installed', array());
        }

        $template->assign_block_vars('switch_topic_location', array());
}
Er parsed einfach den inneren Block (switch_map_mod_installed) nicht...

thx...
Gruß, Dave

Verfasst: 04.09.2004 10:25
von PhilippK
Funktioniert's, wenn du nur auf eine der beiden Konstanten prüfst?

Gruß, Philipp

Verfasst: 04.09.2004 17:56
von D@ve
Nein hab ich schon alles probiert, liegt definitiv an den switchblöcken. Selbst wenn ich alle If-zweige auf true setze funzt es nicht...

Gruß, Dave

Verfasst: 04.09.2004 18:08
von PhilippK
Kannst du mal den entsprechenden Block aus der Template-Datei posten?

Gruß, Philipp

Verfasst: 04.09.2004 18:21
von D@ve
Kann es sein, dass das template-System derartiges garnicht vorsieht?

posting_body.tpl

Code: Alles auswählen

<!-- BEGIN switch_topic_location -->
<tr>
        <td class="row1"><span class="gen"><b>{L_ZIP}/{L_CITY}</b></span></td>
        <td class="row1"><span class="genmed"><input type="text" class="post" name="zip" maxlength="5" size="5" tabindex="1" value="{ZIP}" />&nbsp;<input type="text" class="post" name="city" maxlength="25" size="25" tabindex="1" value="{CITY}" /></span></td>
</tr>
<!-- BEGIN switch_map_mod_installed -->
<tr>
        <td class="row1"><span class="gen"><b>{L_LONGITUDE}/{L_LATITUDE}</b></span></td>
        <td class="row1"><span class="genmed"><input type="text" class="post" name="longitude" maxlength="10" size="10" tabindex="1" value="{LONGITUDE}" />&nbsp;<input type="text" class="post" name="latitude" maxlength="10" size="10" tabindex="1" value="{LATITUDE}" />&nbsp;<input type="submit" name="placesubmit" value="{L_FIND_PLACE}" class="liteoption" onClick="window.open('{U_FIND_PLACE}', '_phpbbsearch', 'HEIGHT=250,resizable=yes,WIDTH=400');return false;" /></span></td>
</tr>
<!-- END switch_map_mod_installed -->
<!-- END switch_topic_location -->
Gruß, Dave