Author Topic: [Question] Adding a new button  (Read 4905 times)

0 Members and 1 Guest are viewing this topic.

Offline fgallery

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • ::: F-Gallery :: Photobank :::
[Question] Adding a new button
« on: January 07, 2006, 08:50:36 PM »
How can I place another button before "Lightbox" "eCard" "Download" "Download (Zip)" ?
The button should support languages and shoud also be inactive for unregistered users.


I've found the code for lightbox button in includes/functions.php and tried to write a similar one for my button
but it doesn't work :(
Here's the code:
Code: [Select]
if ($user_info['user_level'] != GUEST) {
      $postit_button = "<img src=\"".get_gallery_image("postit_off.gif")."\" border=\"0\" alt=\"\" />";
    }
    else {
           $postit_button = "<img src=\"".get_gallery_image("postit.gif")."\" border=\"0\" alt=\"\" />";    }

Any ideas why itsn't working ?
http://f-gallery.com.ua
Artistic Photography, Fashion Photography, Cities and Streets of The World, Personal Photos of Livejournal Users.

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: [Question] Adding a new button
« Reply #1 on: January 07, 2006, 09:27:12 PM »
The easiest way to do it in details.html template. Try add:
Code: [Select]
{if user_loggedin}<img src="{template_lang_image_url}/postit.gif">{endif user_loggedin}{if user_loggedout}<img src="{template_lang_image_url}/postit_off.gif">{endif user_loggedout}If you need also create a link for that button, in details.php find:
Code: [Select]
  "msg" => $msg,Insert below:
Code: [Select]
  "url_postit" => $site_sess->(ROOT_PATH."postit.php"),(asuming you need a link pointed to postit.php file which located in your 4images root directory)
Then you can use {url_postit} tag for the link.
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 fgallery

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • ::: F-Gallery :: Photobank :::
Re: [Question] Adding a new button
« Reply #2 on: January 07, 2006, 09:42:59 PM »
The easiest way to do it in details.html template. Try add:
Code: [Select]
{if user_loggedin}<img src="{template_lang_image_url}/postit.gif">{endif user_loggedin}{if user_loggedout}<img src="{template_lang_image_url}/postit_off.gif">{endif user_loggedout}If you need also create a link for that button, in details.php find:
Code: [Select]
  "msg" => $msg,Insert below:
Code: [Select]
  "url_postit" => $site_sess->(ROOT_PATH."postit.php"),(asuming you need a link pointed to postit.php file which located in your 4images root directory)
Then you can use {url_postit} tag for the link.

V@no I won't lie if I tell you are the master!!!

The link should look like:<A HREF="javascript:popUp('/postit.php?url='+window.location.href+'&name={image_name}&cat_id={cat_id}&media_url={media_url}&thumb={media_thumbnail}&height={height}&width={width}&size={image_file_size}')"></a>
Can I still put it in details.php? I mean how should it look there?
http://f-gallery.com.ua
Artistic Photography, Fashion Photography, Cities and Streets of The World, Personal Photos of Livejournal Users.

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: [Question] Adding a new button
« Reply #3 on: January 07, 2006, 09:51:49 PM »
then in details.php use this line instead:
Code: [Select]
  "url_postit" => $site_sess->(ROOT_PATH."postit.php?1"),and the link should be:
Code: [Select]
<A HREF="javascript:popUp('{url_postit}&url='+window.location.href+'&name={image_name}&cat_id={cat_id}&media_url={media_url}&thumb={media_thumbnail}&height={height}&width={width}&size={image_file_size}')"></a>
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)