[PHPBB] Images for "Login/Logout" & "Subscribe/Unsubscribe"

Discussion in 'Programming' started by pratik, Jul 28, 2009.

  1. #1
    hi there,

    I have am setting up a forum at http://www.forum4finance.com/discuss. I have added icons just under the menu to make it look more appealing. I was able to get the "Register" button working.

    Also the "login" button is working, but partially. I click on the login button and get to the login page, but after logging in i still see the login image... i want to display a logout image instead.
    Its like new users should see "Login" and logged in user should see "Logout"

    The same goes for Subscribe to Topic/Forum... Members should see "Subscribe" and subscribed members should see "Unsubscribed"..

    I am playing around with overall_header for login/logout and overall_footer for subscribe/unsubscribe... But can't get this too buttons to work... :(

    Any help in this matter would be of great help..
    Thanks in advance..
     
    pratik, Jul 28, 2009 IP
  2. pratik

    pratik Notable Member

    Messages:
    2,308
    Likes Received:
    114
    Best Answers:
    0
    Trophy Points:
    200
    #2
    Hey.. there is no one here who can help me with this... ?

    There are some "if" statements that i guess are not working properly.. i mean i am not able to get them work properly...
     
    pratik, Aug 2, 2009 IP
  3. ricky92

    ricky92 Active Member

    Messages:
    16
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    58
    #3
    There are some guides for phpBB's template engine syntax. You can use:
    <!-- IF S_USER_LOGGED_IN -->
    Logout button
    <!-- ELSE -->
    Login button
    <!-- ENDIF -->
     
    ricky92, Aug 3, 2009 IP
    pratik likes this.
  4. pratik

    pratik Notable Member

    Messages:
    2,308
    Likes Received:
    114
    Best Answers:
    0
    Trophy Points:
    200
    #4
    You are a genius... :)
    It worked... Images change... :)
    But there is no links on the images ??? how can i add links to the images...

    see http://forum4finance.com/discuss

    thanks again
     
    pratik, Aug 3, 2009 IP
  5. ricky92

    ricky92 Active Member

    Messages:
    16
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    58
    #5
    You can use the template engine's variable "U_LOGIN_LOGOUT", which will provide a link to either the login or logout page, depending on whether you're logged in or not. Just use this:
    <a href="{U_LOGIN_LOGOUT}" alt="{L_LOGIN_LOGOUT}">
    <!-- IF S_USER_LOGGED_IN -->
    Logout image here
    <!-- ELSE -->
    Login image here
    <!-- ENDIF -->
    </a>
    Code (markup):
     
    ricky92, Aug 3, 2009 IP
  6. pratik

    pratik Notable Member

    Messages:
    2,308
    Likes Received:
    114
    Best Answers:
    0
    Trophy Points:
    200
    #6
    That worked... :)
    thanks a ton buddy.. .

    will also try the same method for subscribe / unsubscribe button...
     
    pratik, Aug 3, 2009 IP
  7. ricky92

    ricky92 Active Member

    Messages:
    16
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    58
    #7
    No problem ;)
    Glad I could help
     
    ricky92, Aug 3, 2009 IP
  8. pratik

    pratik Notable Member

    Messages:
    2,308
    Likes Received:
    114
    Best Answers:
    0
    Trophy Points:
    200
    #8
    Hey there...
    I worked on the subscribe / unsubscribe thing..
    this is how i out it up..

    <!-- IF S_WATCHING_FORUM --><img src="http://www.forum4finance.com/images/unsubscribe.gif" width="85" height="76" alt="Unsubscribe" /><!-- ELSE --><img src="http://www.forum4finance.com/images/subscribe.gif" width="85" height="76" alt="Subscribe" /><!-- ENDIF --><!-- IF S_WATCHING_TOPIC --><img src="http://www.forum4finance.com/images/unsubscribe.gif" width="85" height="76" alt="Unsubscribe" /><!-- ELSE --><img src="http://www.forum4finance.com/images/subscribe.gif" width="85" height="76" alt="Subscribe" /><!-- ENDIF -->
    PHP:
    but now i see two icons on my icon menu... :(
     
    pratik, Aug 3, 2009 IP
  9. ricky92

    ricky92 Active Member

    Messages:
    16
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    58
    #9
    Well, the coding as it is now is supposed to show 2 images... If I understood what you're trying to do, use this code:
    <!-- IF S_WATCHING_FORUM OR S_WATCHING_TOPIC --><img src="http://www.forum4finance.com/images/unsubscribe.gif" width="85" height="76" alt="Unsubscribe" /><!-- ELSE --><img src="http://www.forum4finance.com/images/subscribe.gif" width="85" height="76" alt="Subscribe" /><!-- ENDIF -->
    HTML:
     
    ricky92, Aug 3, 2009 IP
  10. pratik

    pratik Notable Member

    Messages:
    2,308
    Likes Received:
    114
    Best Answers:
    0
    Trophy Points:
    200
    #10
    hi,

    I added the code, but now I see an error.

    Parse error: syntax error, unexpected T_VARIABLE in /home/bizzu0/public_html/forum4finance/discuss/includes/template.php(614) : eval()'d code on line 201
    PHP:
     
    pratik, Aug 4, 2009 IP
  11. ricky92

    ricky92 Active Member

    Messages:
    16
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    58
    #11
    Try a lowercase "OR".
    <!-- IF S_WATCHING_FORUM or S_WATCHING_TOPIC --><img src="http://www.forum4finance.com/images/unsubscribe.gif" width="85" height="76" alt="Unsubscribe" /><!-- ELSE --><img src="http://www.forum4finance.com/images/subscribe.gif" width="85" height="76" alt="Subscribe" /><!-- ENDIF -->
    HTML:
     
    ricky92, Aug 4, 2009 IP
  12. pratik

    pratik Notable Member

    Messages:
    2,308
    Likes Received:
    114
    Best Answers:
    0
    Trophy Points:
    200
    #12
    Hey thanks for replying...

    The error is gone... but still the function is not working...
    What I need is the "subscribe to forum" & "subscribe to thread" option which is there in the footer to come up in the icon...
     
    pratik, Aug 4, 2009 IP
  13. ricky92

    ricky92 Active Member

    Messages:
    16
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    58
    #13
    Okay, I understand the part about getting subscribed to a thread. However I can't seem to find any trace about being subscripted to a forum...? 0.o
     
    ricky92, Aug 4, 2009 IP
  14. pratik

    pratik Notable Member

    Messages:
    2,308
    Likes Received:
    114
    Best Answers:
    0
    Trophy Points:
    200
    #14
    Hey...

    he is an example....
    when you visit here: http://www.phpbb.com/community/viewforum.php?f=14
    in the footer you will see an option "Subscribe forum"

    and when you go here: http://www.phpbb.com/community/viewtopic.php?f=14&t=358419
    in the footer you will see an option "Subscribe topic"

    This is what I want to replicate on top of my forum.

    The code for the same in the footer looks like this

    <!-- IF not S_IS_BOT -->
                    					<!-- IF S_WATCH_FORUM_LINK --><li <!-- IF S_WATCHING_FORUM -->class="icon-unsubscribe-forum"<!-- ELSE -->class="icon-subscribe-forum"<!-- ENDIF -->><a href="{S_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}">{S_WATCH_FORUM_TITLE}</a></li><!-- ENDIF -->
                    					<!-- IF U_WATCH_TOPIC --><li <!-- IF S_WATCHING_TOPIC -->class="icon-unsubscribe-topic"<!-- ELSE -->class="icon-subscribe-topic"<!-- ENDIF -->><a href="{U_WATCH_TOPIC}" title="{L_WATCH_TOPIC}">{L_WATCH_TOPIC}</a></li><!-- ENDIF -->
                    					<!-- IF U_BOOKMARK_TOPIC --><li class="icon-bookmark"><a href="{U_BOOKMARK_TOPIC}" title="{L_BOOKMARK_TOPIC}">{L_BOOKMARK_TOPIC}</a></li><!-- ENDIF -->
    Code (markup):
     
    pratik, Aug 6, 2009 IP