1
   

Unlinking of Map-MOD Links for guests

 
 
BZebra
 
Reply Sun 2 Jan, 2005 07:57 pm
Hello,

I have the Map-MOD installed on my forum. That means I have links to the Map on viewtopic.php under every users postcount.

How can I unlink them, so that the links are only visible for logged in users?

Code in der viewtopic_body.tpl:

Code:<!-- BEGIN switch_map -->
<a href="{postrow.switch_map.U_MAP}" class="gensmall">{postrow.POSTER_FROM}</a>
<!-- END switch_map -->
<!-- BEGIN switch_no_map -->
{postrow.POSTER_FROM}
<!-- END switch_no_map -->


Code in viewtopic.php

Code:'U_POST_ID' => $postrow[$i]['post_id'])
);

//begin map MOD
if (($poster_from != '') && ((float)$postrow[$i]['longitude'] != 0)) {
$template->assign_block_vars('postrow.switch_map', array(
'U_MAP' => append_sid("map.$phpEx?highlight=".$postrow[$i]['user_id'])
));
}
else {
$template->assign_block_vars('postrow.switch_no_map', array());
}
//end map MOD


Thanks a lot,
BZebra
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 605 • Replies: 5
No top replies

 
Craven de Kere
 
  1  
Reply Sun 2 Jan, 2005 08:01 pm
Try wrapping the tpl code in a user-logged in switch.

I don't remember if nested switches work, but give it a try and see.

If it doesn't you can handle it on the php end.
0 Replies
 
BZebra
 
  1  
Reply Mon 3 Jan, 2005 07:03 am
Craven de Kere wrote:
Try wrapping the tpl code in a user-logged in switch.

I don't remember if nested switches work, but give it a try and see.


I allready tried that, it doesn't work.
I guess I have to include it somehow in the if-phrase, but I don't know how this php-code works. Question

I tired it like this

Code://begin map MOD
if (($poster_from != '') && ((float)$postrow[$i]['longitude'] != 0)) {
if ( !$userdata['session_logged_in'] )
{
$template->assign_block_vars('postrow.switch_map', array(
'U_MAP' => append_sid("map.$phpEx?highlight=".$postrow[$i]['user_id'])
));
}
}
else {
$template->assign_block_vars('postrow.switch_no_map', array());
}
//end map MOD


and like this

Code://begin map MOD
if ((!$userdata['session_logged_in']) && ($poster_from != '') && ((float)$postrow[$i]['longitude'] != 0)) {
$template->assign_block_vars('postrow.switch_map', array(
'U_MAP' => append_sid("map.$phpEx?highlight=".$postrow[$i]['user_id'])
));
}
else {
$template->assign_block_vars('postrow.switch_no_map', array());
}
//end map MOD


Nothing works. Rolling Eyes
0 Replies
 
Craven de Kere
 
  1  
Reply Mon 3 Jan, 2005 08:36 am
! means not equal. Try this:

Code:
//begin map MOD
if (($poster_from != '') && ( $userdata['session_logged_in'] ) && ((float)$postrow[$i]['longitude'] != 0)) {
$template->assign_block_vars('postrow.switch_map', array(
'U_MAP' => append_sid("map.$phpEx?highlight=".$postrow[$i]['user_id'])
));
}
else {
$template->assign_block_vars('postrow.switch_no_map', array());
}
//end map MOD
0 Replies
 
BZebra
 
  1  
Reply Mon 3 Jan, 2005 10:20 am
It works!
Thanks a lot Craven! Very Happy
0 Replies
 
Craven de Kere
 
  1  
Reply Mon 3 Jan, 2005 12:08 pm
My pleasure.
0 Replies
 
 

Related Topics

Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » Unlinking of Map-MOD Links for guests
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 01/18/2025 at 02:02:53