Forums

Replace email adress with an Image

bambid 03 Feb, 2010
Hello

I tried to Replace the Emailadress with an image with this code

<a href="mailto:{VarMail}"><img src="/.../.../HomepageB.png"></a>

but there is in the result a problem with the email spambot



How i have to set this Tag that it works

MfG bambid
GreyHead 03 Feb, 2010
Hi bambid,

Turn off the Email spambot - or set it to run before the ChronoForms plugin.

Bob
bambid 03 Feb, 2010
Ok

i searched for this option to deactivate the spambot but i can't find it! can you tell me where i can find it? or what was that with the chronoform you have told?

greets

bambid
GreyHead 03 Feb, 2010
Hi bambid,

The Joomla spambot is the 'Email Cloaking' plugin which lives in Site Admin | Extensions | Plugin Manager.

If it is some other spambot then I don't know where it might be.

Bob
bambid 04 Feb, 2010
Hello Greyhead

that works great!

now i got an ather problem!

I replaced the Edittext with an image. this was not the problem, but an unregistred user see also this image. is it posible to say that un unregistred user will not see them?

i tried it like that:

if ({edit_record} == "" )
{
echo "";
}

else {
echo "<td><div align='right'><a href='{edit_record}' target='_blank'><img src='/images/smilies/Edit.png'></div></td>";
echo "<td><div align='right'><a href='{delete_record}' target='_blank'><img src='/images/smilies/Delete.png'></div></td>";
}


But {edit_record} seems not to be empty if someone isn't logged in.

can you tell me how i can check if someone is logged in or not.

Thanks for your replay

Best Reguards
bambid
GreyHead 04 Feb, 2010
Hi bambid,

I think that you can set the View and Edit permissions to only allow Registered users to edit in which case the link shouldn't be visible to non-registerd users.

Bob
bambid 05 Feb, 2010
Hello
That does not work, because the image witch i load like that:
<a href='{edit_record}' target='_blank'><img src='/images/smilies/Edit.png'>

load only the link right. If i'm logged in the link works and if i'm not logged in the link gifs back a blank page.
i need to hafe a possibility to check if a user is logged in or not.

Thanks
GreyHead 05 Feb, 2010
Hi bambid;

You can always check the User Object
<?php
$user =& JFactory::getUser();
if ( $user->id ) {
  // user is logged in 
} else {
  // user is a guest
}
?>

Bob
bambid 05 Feb, 2010
great
thx

greetz
bambid
bambid 08 Feb, 2010
Hello

i got an ather problem.

i tried to match {cf_user_id} with the real user how is right now online.

i get the information for this user with:
$uid=$user->get("id");


But the {cf_user_id} has a string leght of: 12 characters and
$uid has only 7 characters.

But in echo() bouth got the same value.

how can i make the match of the {cf_user_id} and $uid?

Thanks bambid
GreyHead 08 Feb, 2010
Hi bambid,

They are both integers so the lengths shouldn't matter. How are you comparing them?

Bob
bambid 08 Feb, 2010
Hello Bob

ok i tried to match them like that:

$uid=$user->get("id");
$cfuid='{cf_user_id}';

if ($uid==$cfuid)
{
echo "right";
}
else
{
echo "false";
}

but there is no match!

thanks
GreyHead 08 Feb, 2010
Hi bambid,

Where are you trying to do the comparison? The {field_name} syntax will only work in a few places.

What are you trying to achieve - this may not be the best approach.

Bob
bambid 08 Feb, 2010
Ok the Problem is, i got a list of clubs where every club can insert and edit by himself. But the problem is: now can every logged in user edit all club entrys but my purpose is to give, in the body list, an if question like:

if (($cfuid==$uid) or ($utype == "Super Administrator"))
{				
echo "<td><div align='right'><a href='{edit_record}' target='_blank'><img src='/images/smilies/Edit.png'></div></td>";
}
else 
{
echo "<td></td>";
}


but this will not work. i tried to find out why and one of the problems i saw was with:

echo strlen($cfuid);


how can i give the edit link only the user who entered the club?

thanks bambid
This topic is locked and no more replies can be posted.