Author Topic: user permission (messages and tooltip)  (Read 59811 times)

0 Members and 2 Guests are viewing this topic.

Offline Eagle Eye

  • Full Member
  • ***
  • Posts: 191
    • View Profile
user permission (messages and tooltip)
« 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

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: user permission (messages and tooltip)
« Reply #1 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. ;)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: user permission (messages and tooltip)
« Reply #2 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.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: user permission (messages and tooltip)
« Reply #3 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.

Offline Eagle Eye

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Re: user permission (messages and tooltip)
« Reply #4 on: January 21, 2006, 05:58:35 PM »
Thanks V@no & TheOracle

got it working fine
 :D

Offline Eagle Eye

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Re: user permission (messages and tooltip)
« Reply #5 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}  :(

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: user permission (messages and tooltip)
« Reply #6 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.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Eagle Eye

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Re: user permission (messages and tooltip)
« Reply #7 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



Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: user permission (messages and tooltip)
« Reply #8 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
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: user permission (messages and tooltip)
« Reply #9 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!
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: user permission (messages and tooltip)
« Reply #10 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
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: user permission (messages and tooltip)
« Reply #11 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 ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Eagle Eye

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Re: user permission (messages and tooltip)
« Reply #12 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

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: user permission (messages and tooltip)
« Reply #13 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 site works also slower ...
... and another slow working site you can find ... here below ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: user permission (messages and tooltip)
« Reply #14 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. ;)