4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: Eagle Eye on January 21, 2006, 03:13:16 PM

Title: user permission (messages and tooltip)
Post by: Eagle Eye on January 21, 2006, 03:13:16 PM
Hello

1) How can we show a tool tip on images, if the user is not logged in, or does not have the required permission (like on V@no’s site ;) )

2) What code should be added to the home page, template, so that if the use is not logged in, we can show a specific message (like login and have fun etc…) and if logged in, then another message....

I know it must have been discussed here in the forum, but I am not able to find it here, please hint me if any,

Thanks
 :D
Title: Re: user permission (messages and tooltip)
Post by: TheOracle on January 21, 2006, 03:30:52 PM
No. 1 : It could be done by implementing a JS script from http://www.dynamicdrive.com . ;)

No . 2 : I like this idea. However, it can easily be done by going into your lang/<your_lang>/main.php file and add a new array on top of your "?>" tag. Then, register a new array into your index.php file. Finally, you can use the : {welcome_message} tag on your template/<your_template>/home.html file like this :

Code: [Select]

{ifno user_loggedin}
{welcome_message}
{endifno user_loggedin}


Note: The {Ifno ...} MOD must be installed. ;)

Note: As a personal alternative solution, I use the Another Simple Publishing News MOD as I have already intergrated a welcome message for GUEST level into the homepage and it works perfectly. ;)
Title: Re: user permission (messages and tooltip)
Post by: V@no on January 21, 2006, 05:38:12 PM
1) I'm using http://www.walterzorn.com/tooltip/tooltip_e.htm script, its a very much cross-browser compatible and rediculousy easy to use and install :)
Just add in thumbnail_bit.html template into your <img> tag:
Code: [Select]
{if user_loggedout} onmouseover="return escape('whatever message you want to be showed');"{endif user_loggedout}

2) A little addition to TheOracle answer: you also can use {if user_loggedout} .... {endif user_loggedout} tags without needed installing additional mod.
Title: Re: user permission (messages and tooltip)
Post by: TheOracle on January 21, 2006, 05:57:05 PM
Quote

2) A little addition to TheOracle answer: you also can use {if user_loggedout} .... {endif user_loggedout} tags without needed installing additional mod.


Correct.
Title: Re: user permission (messages and tooltip)
Post by: Eagle Eye on January 21, 2006, 05:58:35 PM
Thanks V@no & TheOracle

got it working fine
 :D
Title: Re: user permission (messages and tooltip)
Post by: Eagle Eye on January 21, 2006, 06:19:16 PM
Just add in thumbnail_bit.html template into your <img> tag:
Code: [Select]
{if user_loggedout} onmouseover="return escape('whatever message you want to be showed');"{endif user_loggedout}

Please excuse me, i did not find any <img> tag in thumbnail_bit.html just {thumbnail}  :(
Title: Re: user permission (messages and tooltip)
Post by: V@no on January 21, 2006, 06:29:15 PM
ops...its actualy whatever HTML you have around {thumbnail}.
For example I'm using tables, so I added inside <td> tag. You might have <div> so add it inside of it.
Title: Re: user permission (messages and tooltip)
Post by: Eagle Eye on January 21, 2006, 06:51:44 PM
Coool!  :lol: got it working!!!

Actually I am using a 7dana template with the thumbnail column selection on mouse over, so deicide it this way

Code: [Select]
<td align="center" class="thumb"  {if user_loggedin}onmouseover="this.className='thumb2'" onmouseout="this.className='thumb'"{endif user_loggedin}{if user_loggedout} onmouseover="return escape('Please register/login to view this image!');"{endif user_loggedout}>
{thumbnail}<br />

Thanks  :D


Title: Re: user permission (messages and tooltip)
Post by: mawenzi on January 22, 2006, 01:04:43 AM
... very nice feature ...
... but the script must insert immediately before the closing </body> tag ...
... and that is the reason of a long loading time of the website in MSIE not in FF ... also of gallery.vano.org ... ! ...  :(
... but if all visitors of your websites use FF ... than ok ...  :roll:

mawenzi
Title: Re: user permission (messages and tooltip)
Post by: V@no on January 22, 2006, 01:35:58 AM
... but the script must insert immediately before the closing </body> tag ...
yes, I put it in footer.html


... an that is the reason of a long loading time of the website in MSIE not in FF ... also of gallery.vano.org ... ! ...  :(
Its not caused but this script, its probably by the JS that I use to give PNG alpha transparency support on IE6, which scans the entrire page for .png files..cant wait untill IE7 is finaly out!
Title: Re: user permission (messages and tooltip)
Post by: mawenzi on January 22, 2006, 02:33:56 AM
... Its not caused but this script ...
... but on my testsite and on walterzorn.com itself ...
... it is the different way of MSIE and FF to show a website ... FF begins directly ... MSIE begins after getting all infos ...
... and if such a script lies in the footer, there is a long time of loading the website in MSIE ...

mawenzi
Title: Re: user permission (messages and tooltip)
Post by: V@no on January 22, 2006, 03:27:17 AM
hmm...what if you leave only the tags were you are planning to use that javascript on:
Code: [Select]
//////////////  TAGS WITH TOOLTIP FUNCTIONALITY  ////////////////////
// List may be extended or shortened:
var tt_tags = new Array("a","area","b","big","caption","center","code","dd","div","dl","dt","em","h1","h2","h3","h4","h5","h6","i","img","input","li","map","ol","p","pre","s", "select", "small","span","strike","strong","sub","sup","table","td","th","tr","tt","u","var","ul","layer");
/////////////////////////////////////////////////////////////////////
In my case I only using it on <TD> tag, so I've replaced it on:
Code: [Select]
var tt_tags = new Array("td");See if it helps ;)

P.S. would like to see your test site ;)
Title: Re: user permission (messages and tooltip)
Post by: Eagle Eye on January 22, 2006, 02:29:33 PM
In my case I only using it on <TD> tag, so I've replaced it on:
Code: [Select]
var tt_tags = new Array("td");See if it helps ;)


Nice tip! anyway i seem to be not having problems in loading time.... and this script is a light one, maybe like V@no said, its due to his other JS scripts..
Thanks guys :D
Title: Re: user permission (messages and tooltip)
Post by: mawenzi on January 24, 2006, 01:04:30 AM
... for using the tooltip only for "No Permission"-Images or "Image-Name / No Permission"  / "Image-Name" ...
... you can try this : http://www.4homepages.de/forum/index.php?topic=11270.msg58414#msg58414

@V@no
... after installing the tooltip script this (http://www.thepictureworld.de/) site works also slower ...
... and another slow working site you can find ... here below ...
Title: Re: user permission (messages and tooltip)
Post by: TheOracle on January 24, 2006, 01:11:01 AM
Thanks for the tip Mawenzi. However, this line :

Quote

$no_permission = (!empty($show_link)) ? "" : "Für dieses Bild musst du eingeloggt sein !";


should be put under $lang in case other languages modules are installed and, in addition, more users would like to  implement this feature. ;)
Title: Re: user permission (messages and tooltip)
Post by: mawenzi on January 24, 2006, 01:22:20 AM
@TheOracle
... it is not a MOD ... it was only a tip for Chicco ( a german user ) ...
... but if you want : please add the $lang to the thread ( for our english speaking users ) ...
... thanks in advance ...  :wink:

mawenzi
Title: Re: user permission (messages and tooltip)
Post by: V@no on January 24, 2006, 01:31:18 AM
@V@no
... after installing the tooltip script this (http://www.thepictureworld.de/) site works also slower ...
... and another slow working site you can find ... here below ...
I don't know how it was working before, but for me it opens very fast...
Title: Re: user permission (messages and tooltip)
Post by: mawenzi on January 24, 2006, 01:38:31 AM
@ V@no
... also this (http://klick.kl.funpic.de/categories.php?cat_id=19) ... ?
Title: Re: user permission (messages and tooltip)
Post by: V@no on January 24, 2006, 02:24:25 AM
Lets see...the front page is almost 200kb (uncompressed, dont check it with FF, it compress pages in the cache and shows the compressed size), with quiet a few javascripts, which possibly could scan entire (200kb!) page for whatever they are supposed to scan (its my speculation on that one) and besides that, you are using some sort of "preloading" script, that shows a message untill all items of the page fully loaded...I guess, if you remove the preloading script, maybe then you'll be able to tell if its slower or not ;)
So, after all that, adding another JS could possibly overload the browser, which would slow down the rendering process...
Title: Re: user permission (messages and tooltip)
Post by: mawenzi on January 24, 2006, 02:07:25 PM
@ V@no
... thanks for your statements and views ...

mawenzi
Title: Re: user permission (messages and tooltip)
Post by: Eagle Eye on January 24, 2006, 09:56:56 PM
Quote
V@no
... after installing the tooltip script this (http://www.thepictureworld.de/) site works also slower ...
... and another slow working site you can find ... here below ...

maybe the site is working slow, due to big tables (lot of information show in so many nested tables- all in one big table), if the tables were separated out then the browser could have processed each table faster... I guess this is the problem... this script works fine :)
Title: Re: user permission (messages and tooltip)
Post by: TheOracle on January 24, 2006, 10:18:07 PM
@maxpaul:

It is doubtful that HTML tables would slow down a site - unless extensive presentation would be involved (but it doesn't seem to be the case here). ;)

It's probably a scripting problem elsewhere on the script.
Title: Re: user permission (messages and tooltip)
Post by: Sir Sky-Walker on February 12, 2006, 05:57:04 PM
I have thise error:

Parse error: parse error, unexpected T_STRING in /usr/export/www/vhosts/funnetwork/hosting/olpi/4images/includes/template.php(133) : eval()'d code on line 578

My thumbnail_bit.html is looking at this moment:

<!-- you wish detail page in a small javascript open window, use {thumbnail_openwindow} -->
<b>{image_name}</b>&nbsp;&nbsp;{if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new}
<br /> {if user_loggedout} onmouseover="return escape('whatever message you want to be showed');"{endif user_loggedout}  {thumbnail}<br />
<a href="{cat_url}">{cat_name}</a><br />
{if allow_comments}{lang_comments} {image_comments}{endif allow_comments}<br /><img src="{template_image_url}/{image_rating_round}.gif">
<br>Hits:&nbsp;{lang_hits}{image_hits}</br><p>{if image_is_potm}{lang_potm}{endif image_is_potm}</p>

I have only put in the code. Or musst I do anythink else?

Sorry for my bad english. German is better ;-)
Title: Re: user permission (messages and tooltip)
Post by: TheOracle on February 12, 2006, 06:14:28 PM
Quote

Parse error: parse error, unexpected T_STRING in /usr/export/www/vhosts/funnetwork/hosting/olpi/4images/includes/template.php(133) : eval()'d code on line 578


This error has been covered in the FAQ already. Please visit that section (or use the forum's search engine). ;)
Title: Re: user permission (messages and tooltip)
Post by: BartAfterDark on February 19, 2006, 02:07:20 PM
Anyone tried this with random images
It wont work for me when I use this code
Code: [Select]
<span{if user_loggedout} onmouseover="return escape('Please register/login to view this image!');"{endif user_loggedout}>{thumbnail}<br /></span>
Title: Re: user permission (messages and tooltip)
Post by: V@no on February 19, 2006, 07:40:34 PM
There are two templates for random images, did you add this into both of them? (a link to your site could help too ;))
Title: Re: user permission (messages and tooltip)
Post by: BartAfterDark on February 19, 2006, 08:40:36 PM
Can't post a link right now (behind proxy/ISA server) :(
But the problem is {if user_loggedout} as soon I remove the tags it works. (But then it shows for all images)
Title: Re: user permission (messages and tooltip)
Post by: V@no on February 19, 2006, 08:51:30 PM
In includes/page_header.php find:
Code: [Select]
  "self" => $site_sess->url($self_url),Insert below:
Code: [Select]
  "user_loggedin" => ($user_info['user_level'] == GUEST) ? 0 : 1,
  "user_loggedout" => ($user_info['user_level'] == GUEST) ? 1 : 0,
  "is_admin" => ($user_info['user_level'] == ADMIN) ? 1 : 0,
Title: Re: user permission (messages and tooltip)
Post by: BartAfterDark on February 19, 2006, 08:55:01 PM
WOW.
That worked.
Thank you soo much v@no ;)
Did I miss a FIX ?

Title: Re: user permission (messages and tooltip)
Post by: V@no on February 19, 2006, 08:59:16 PM
Did I miss a FIX ?
No, it wasnt discovered till now ;)
Title: Re: user permission (messages and tooltip)
Post by: BartAfterDark on February 19, 2006, 09:05:05 PM
he okay ;)
Thank You again. You make life worth living again :p
Title: Re: user permission (messages and tooltip)
Post by: Fastian on March 14, 2006, 07:04:23 PM
This is indeed a nice script. 
I want to add it on the detail page . On mouse over the detail image. But I cant find where to add the code.

I guess the actual image link comes with " {image} " in detail.html.  How can I add this code there ?? ?
Title: Re: user permission (messages and tooltip)
Post by: Eagle Eye on March 14, 2006, 08:12:26 PM
To make the tool tip appear on the details page, u need to add the code into templates/<you template>/media/   to the files jpg.html, gif.html etc as per ur requirements....

Best is to add the following code inside the <td> tag just before the {media_src}

U can also add images (like the smiley i added on www.hotdt.com (http://www.hotdt.com)
Here is my code preview in the <td> tag
Code: [Select]
onmouseover="return escape('&lt;b&gt;::  {image_name}  ::&lt;/b&gt;&lt;br&gt;&lt;br&gt; To view 1024x768px wallpaper&lt;br&gt; click on the picture.&lt;br&gt; Please rate this wallpaper! &lt;img src=\'{template_url}/images/login.gif\' width=\'18\'&gt;')"
tip: if u decide to add it to the <td> tag then comment of the others tags in the .js file and just leave:
Quote
var tt_tags = new Array("td");

if u are interested in the popup function tell me ;)

Hope this was helpful ;)
Regards  :D
Title: Re: user permission (messages and tooltip)
Post by: Fastian on March 15, 2006, 06:25:37 PM
Thanks Max
It really helped me.

Quote
if u are interested in the popup function tell me

Which popup??  I always want to get more  :D  So please share it.
Title: Re: user permission (messages and tooltip)
Post by: Eagle Eye on March 15, 2006, 06:39:23 PM
at www.hotdt.com (http://www.hotdt.com), on the details image page, when u click on the image, a popup windows comes up, showing the orginal image,

add this javascript to your .js file
Code: [Select]
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

and in between td tags

Code: [Select]
<a href="{media_src}" onClick="NewWindow(this.href,'name','1024','768','yes');return false">
enjoy ;)
Title: Re: user permission (messages and tooltip)
Post by: JensF on March 26, 2006, 06:19:17 PM
1) I'm using http://www.walterzorn.com/tooltip/tooltip_e.htm script, its a very much cross-browser compatible and rediculousy easy to use and install :)
Just add in thumbnail_bit.html template into your <img> tag:
Code: [Select]
{if user_loggedout} onmouseover="return escape('whatever message you want to be showed');"{endif user_loggedout}

2) A little addition to TheOracle answer: you also can use {if user_loggedout} .... {endif user_loggedout} tags without needed installing additional mod.

Hi there,

i have test this but it doesn´t work :(

I have copy the wz_tooltip.js in my template folder and in my user_logininfo.html i have do this

Quote
<img src="templates/4grey2/icons/einstellungen.gif" onmouseover="return escape('whatever message you want to be showed');">

But it has no effect :(
Title: Re: user permission (messages and tooltip)
Post by: Fastian on March 26, 2006, 11:59:33 PM
I am no expert but try this.

Use
Code: [Select]
<img src="{template_url}/icons/einstellungen.gif">
and you must insert
Code: [Select]
<script language="JavaScript" type="text/javascript" src="{template_url}/wz_tooltip.js"></script>
In your footer.html

I assume your wz_tooltip.js in your template folder.
Title: Re: user permission (messages and tooltip)
Post by: Fastian on March 28, 2006, 11:57:21 PM
I am using this Tool in many times in my site & with success.

Few days back , I tried to use it in jpg.html
My code is like this
Code: [Select]
<table width="535" height="402" border="0" align="center" cellpadding="0">
  <tr>
    <td align="center" valign="middle" background="{template_url}/images/lc.gif"><table width="533" height="400" border="0" cellpadding="0">
      <tr>
        <td><img src="{media_src}" border="1" onmouseover="this.T_TITLE='{image_name}';return escape('To Download Full Screen Wallpaper (1024x768) Use The <b>Download</b> Button Below The Image. </br> By Saving This Image Using Right Click, You Will Not Get The Actual Image')" width="533" height="400"/></td>
      </tr>
      </table></td>
      </tr>
</table>

The thing is, when the mouse moves out of the image, the whole page "Blinks" for a second. (I don’t know what to call it)

But this is happening when I added background image. If I remove that part, it woks just fine.

Is there something wrong in the code?  :?
Title: Re: user permission (messages and tooltip)
Post by: V@no on March 29, 2006, 01:58:30 AM
did you try insert it into the table and not into the image?
Title: Re: user permission (messages and tooltip)
Post by: Fastian on March 29, 2006, 04:45:15 PM
did you try insert it into the table and not into the image?

Works perfect now   :D

Thanks V@no
Title: Re: user permission (messages and tooltip)
Post by: Fastian on April 07, 2006, 02:49:42 PM
I am using tool tip txt in jpg.html and it works just perfect.
I want to do something and was wondering if it could be done with this tool tip.

In my site, I have few categories where only registered users can download images. So I was wondering if I can show two different text in jpg.html.

Something like

If download button enable
Show tooltip 1
If download button disable
Show tooltip 2

Would it be possible ?  :?:
Title: Re: user permission (messages and tooltip)
Post by: Eagle Eye on April 07, 2006, 02:57:42 PM
Try to place this tag inside the message quotes in the jpg.html

{if user_loggedout}message for non registered or non loggedin users{endif user_loggedout}{if user_loggedin}message for registered users{endif user_loggedin}

:D

Title: Re: user permission (messages and tooltip)
Post by: dgparent on April 27, 2006, 03:31:16 PM
Try to place this tag inside the message quotes in the jpg.html

{if user_loggedout}message for non registered or non loggedin users{endif user_loggedout}{if user_loggedin}message for registered users{endif user_loggedin}

:D



 I can't find any jpg.html file ?? I am using the standard template and really want a message for people that are not registered to show up when they go to click on a image, but can't get any of these to work.
Title: Re: user permission (messages and tooltip)
Post by: V@no on April 28, 2006, 01:50:43 AM
try media folder ;)
Title: Re: user permission (messages and tooltip)
Post by: TIMT on May 06, 2006, 10:02:02 PM
Hi,

I put the following two lines into categories.html and details.html

Code: [Select]
<script type="text/javascript" src="./templates/photofront/wz_tooltip.js" language="JavaScript" ></script>
<a href="index.php" onmouseover="return escape('asffsffsfasdf')">Homepage </a>

On both sites the link is displayed but not the tooltip.

thanks for helping me
Title: Re: user permission (messages and tooltip)
Post by: Eagle Eye on May 06, 2006, 10:21:20 PM
Hi,

I put the following two lines into categories.html and details.html

Code: [Select]
<script type="text/javascript" src="./templates/photofront/wz_tooltip.js" language="JavaScript" ></script>
<a href="index.php" onmouseover="return escape('asffsffsfasdf')">Homepage </a>

On both sites the link is displayed but not the tooltip.

thanks for helping me


try to put
Code: [Select]
<script type="text/javascript" src="{template_url}/wz_tooltip.js" language="JavaScript" ></script> in footer.html and it should work fine  :wink:
Title: Re: user permission (messages and tooltip)
Post by: TIMT on May 06, 2006, 10:57:52 PM
Thanks, it works perfect!   :D
Title: Re: user permission (messages and tooltip)
Post by: leh00 on August 05, 2006, 12:40:39 PM
I would like to add the message to main.php like TheOracle mentioned in this tread

I added:
Code: [Select]
$lang['no_permission_msg']= "Details nur für <B>eingeloggte</B> Mitglieder oder <B>unzureichende</B> Rechte <img src=\'{template_url}/smilies/cool.gif\'>";
to main.php.

I added:
 
Code: [Select]
"lang_no_permission_msg" => $lang['no_permission_msg'],
to the part $site_template->register_vars(array( in page_header.php

I added/updated:
 
Code: [Select]
$no_permission = (!empty($show_link)) ? "" : "{lang_no_permission_msg}";
in functions.php

The message does not show up when the page is loaded...

When I replace the message in functions.php it works... somehow it's not loaded correctly... :roll:

Any help is appreciated...

Regards

Leh00

I solved it:

To use the code {lang_no_permission_msg} was wrong -> after adding {lang_no_permission_msg} to random_imgage.html and thumbnail_bit.html it works perfect.
Title: Problem with single quote in categorie description
Post by: leh00 on October 05, 2006, 08:09:39 PM
I tried to add the category description to the tooltip... everthing works fine till I have a link to a image in the description.

Example:
Code: [Select]
<div onmouseover="return escape('<B>{cat_description}</B>...
and this is what I get out in the browser...

onmouseover="return escape('<B>Cat Text<img src='./../templates/abc/smilies/smile.gif'></B>')

I tried to add the \ to the text in the description like: "Cat Text<img src=\'./../templates/abc/smilies/smile.gif\'> but the "\" are lost -> filtered by the code...

Any ideas?

Regards

Leh00