Icy Phoenix

     
 

Need Help Adding Link Variables

Need Help Adding Link Variables

Article
Reply with quote    Download Post  
Post Need Help Adding Link Variables 
 
i am wanting to add my own variable so i can use my own links in the templates.

like i want to change {u_portal} to go to portal.php
and also add {u_about} to go to about.php or so on but i can't figure out where to change these settings or to add them.

i know with phpbb it would be common.php and functions.php but i can't even figure it out i found out where to add my own l_variable to the list but now i need to figure out how to change the u_ part



 
juggalo_master - View user's profile Send private message  
juggalo_master [ Tue 04 Sep, 2012 03:15 ]
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us


Need Help Adding Link Variables

Comments
Reply with quote    Download Post  
Post Re: Need Help adding Link Variables 
 
Links are all now situated in the default.cfg file in your default template folder..

To add a new link you need to place your code anywhere after

// LINKS - BEGIN

        
Code: [Download] [Hide] [Select]
'U_ABOUT' => append_sid(IP_ROOT_PATH . 'about.' . PHP_EXT),


then open includes/functions.php and find

Code: [Download] [Hide] [Select]
        'L_PROFILE' => $lang['Profile'],


after add

Code: [Download] [Hide] [Select]
        'L_ABOUT' => $lang['About'],


finally open language/lang_english/lang_main.php (or your langage folder if different form english)

find

Code: [Download] [Hide] [Select]
    'Profile' => 'Profile',


add after

Code: [Download] [Hide] [Select]
        'About' => 'About',


and off course add the link to your overall_header.tpl in the default template or check if that file exists in the folder of any other template you are using....

obviously you can name the link whatever you like..

Hope that helps

   



 
DWho - View user's profile Send private message  
DWho [ Tue 04 Sep, 2012 09:48 ]
Reply with quote    Download Post  
Post Re: Need Help adding Link Variables 
 
Is is not easier to work with dynamic menu in CMS?

I did not test it in header, only in main links.

The advantage of this is, that everything is stored in the database, so you can not be in trouble by updating.



 
TheSteffen - View user's profile Send private message  
TheSteffen [ Tue 04 Sep, 2012 10:31 ]
Reply with quote    Download Post  
Post Re: Need Help Adding Link Variables 
 
I was going to go this way.  

Open:

default.cfg

Find:

?>

Before Add:

Code: [Download] [Hide] [Select]
// My Own template variables

// START About MOD
$template->assign_vars(array(
'L_ABOUT' => $lang['About'],
'U_ABOUT' => append_sid(IP_ROOT_PATH . 'about.' . PHP_EXT),
    )
);
// END About MOD


Create a file: lang_extend_my_mods.php with the script below and copy it to your language folder.


Code: [Download] [Hide] [Select]
<?php
/**
*
* @package Icy Phoenix Modifications
* @File $Id: lang_extend_aboutl_mod.php
* @copyright (c)
* @license: http://opensource.org/licenses/GPL-license.php GNU Public License
*/

/**
*
* @Extra credits for this file
* Modified for Icy Phoenix by Lopalong - 31-January-2009
*
*/

if (!defined('IN_ICYPHOENIX'))
{
    exit;
}

if (empty($lang) || !is_array($lang))
{
    $lang = array();
}

$lang = array_merge($lang, array(

// START My Language

    'ABOUT' => 'About',

// END My Language
    )
);

?>


So now you have umpteen ways of doing it.  



 
Edited by mort, Wed 05 Sep, 2012 02:19: Removed non-function script.
mort - View user's profile Send private message  
mort [ Tue 04 Sep, 2012 12:45 ]
Reply with quote    Download Post  
Post Re: Need Help adding Link Variables 
 
 
Off Topic
:
I've edited all topic titles in this thread guys, juggalo_master please try using topic titles that describe the question... thanks

PS.. GREAT info  




 
Joshua203 - View user's profile Send private message  
Joshua203 [ Tue 04 Sep, 2012 13:21 ]
Reply with quote    Download Post  
Post Re: Need Help Adding Link Variables 
 
thanks guys. that saved me so much aggravation and frustration i was searching through files for like atleast 2 hrs before i asked. but now i know where i can go and add my links into the functions.



 
juggalo_master - View user's profile Send private message  
juggalo_master [ Tue 04 Sep, 2012 14:05 ]
Reply with quote    Download Post  
Post Re: Need Help Adding Link Variables 
 
juggalo_master wrote: [View Post]
I was searching through files for like at least 2 hrs.


If you had something like Notepad++ you could have done it in 10 minutes!  

http://notepad-plus-plus.org/

 



 
mort - View user's profile Send private message  
mort [ Tue 04 Sep, 2012 14:22 ]
Reply with quote    Download Post  
Post Re: Need Help Adding Link Variables 
 
Also use Windows Grep will search through folders and files for the word you place into the search function...

   



 
DWho - View user's profile Send private message  
DWho [ Tue 04 Sep, 2012 14:59 ]
Reply with quote    Download Post  
Post Re: Need Help Adding Link Variables 
 
mort wrote: [View Post]
juggalo_master wrote: [View Post]
I was searching through files for like at least 2 hrs.


If you had something like Notepad++ you could have done it in 10 minutes!  

http://notepad-plus-plus.org/

 


i don't like notepadd ++ it always destroy my designs.

DWho wrote: [View Post]
Also use Windows Grep will search through folders and files for the word you place into the search function...

   


i will check that program out later.

but thanks for the support and help.

i got another question, how would i go about putting a login box into my template and having it show user details after logging in and hidding the login box?

i don't have include overall_header.tpl and footer file.

http://www.animenewsinc.net is my website i am working on



 
juggalo_master - View user's profile Send private message  
juggalo_master [ Wed 05 Sep, 2012 05:20 ]
Reply with quote    Download Post  
Post Re: Need Help Adding Link Variables 
 
<!-- IF S_LOGGED_IN -->

Logged-in data

        <!-- ELSE -->

Logged-Out data

        <!-- ENDIF -->



 
mort - View user's profile Send private message  
mort [ Wed 05 Sep, 2012 06:09 ]
Reply with quote    Download Post  
Post Re: Need Help Adding Link Variables 
 
mort wrote: [View Post]
<!-- IF S_LOGGED_IN -->

Logged-in data

        <!-- ELSE -->

Logged-Out data

        <!-- ENDIF -->

ok i got it to work now how would i show the user's avatar and username and log out after loggin in.

i would like to show the users details on the page after they log into the site.



 
juggalo_master - View user's profile Send private message  
juggalo_master [ Wed 05 Sep, 2012 07:52 ]
Reply with quote    Download Post  
Post Re: Need Help Adding Link Variables 
 
Have a look at this - -

templates/default/blocks/user_block_block.tpl

It should give you more of an idea on how it works.  

One problem you may run into is that NOT all variables are global, so you may have to create a new php and tpl page and redefine them.

Don't know, as I'm not sure as to what you are actually trying to do and where you are placing it.  



 
mort - View user's profile Send private message  
mort [ Wed 05 Sep, 2012 09:10 ]
Reply with quote    Download Post  
Post Re: Need Help Adding Link Variables 
 
if you look at my page and look where categories is i would be placing a log in box there for guests and for logged in users it would show there details like username, pms, avatar like it does on the forum/phpbb3 forum.

i am trying to get a log in box to work and get the user details variable for templates to work properly.
Code: [Download] [Hide]
  1.  
  2. <!-- IF S_LOGGED_IN --> 
  3. <table class="empty-table" width="100%" cellspacing="0" cellpadding="0" border="0"> 
  4. <tr> 
  5.     <td align="center"> 
  6.         <br />{AVATAR_IMG}<br /><br /> 
  7.         <span class="name">{U_NAME_LINK}</span><br /> 
  8.         <span class="gensmall">{LAST_VISIT_DATE}</span><br /> 
  9.         <span class="gensmall"><a href="{U_SEARCH_NEW}">{L_NEW_SEARCH}</a></span><br /><br /> 
  10.     </td> 
  11. </tr> 
  12. </table> 
  13. <!-- ELSE --> 
  14. <form method="post" action="{S_LOGIN_ACTION}"> 
  15. <table class="empty-table" width="100%" cellspacing="0" cellpadding="0" border="0"> 
  16. <tr> 
  17.     <td align="center"> 
  18.     <br /> 
  19.     {AVATAR_IMG}<br /><br /><span class="gensmall"> 
  20.     <input type="hidden" name="redirect" value="{U_PORTAL_NOSID}" /> 
  21.     {L_USERNAME}:<br /> 
  22.     <input class="post" type="text" name="username" size="15" /> 
  23.     <br /> 
  24.     {L_PASSWORD}:<br /> 
  25.     <input class="post" type="password" name="password" size="15" /> 
  26.     <br /> 
  27.     </span> 
  28.     <!-- BEGIN switch_allow_autologin --> 
  29.     <br /> 
  30.     <input class="text" type="checkbox" name="autologin" /><span class="gensmall">&nbsp;{L_REMEMBER_ME}</span><br /> 
  31.     <!-- END switch_allow_autologin --> 
  32.     <br /> 
  33.     <input type="submit" class="mainoption" name="login" value="{L_LOGIN}" /><br /><br /> 
  34.     <a href="{U_SEND_PASSWORD}" class="gensmall">{L_SEND_PASSWORD}</a><br /><br /> 
  35.     <span class="gensmall">{L_REGISTER_NEW_ACCOUNT}</span><br /><br /> 
  36.     </td> 
  37. </tr> 
  38. </table> 
  39. </form> 
  40. <!-- ENDIF --> 




 
juggalo_master - View user's profile Send private message  
juggalo_master [ Wed 05 Sep, 2012 14:10 ]
Reply with quote    Download Post  
Post Re: Need Help Adding Link Variables 
 
Then you want something like this. (You will need to move things around, and add permissions and markup etc.)  

Spoiler: [ Show ]


Open forum.php
Spoiler: [ Show ]


Now you can see what I meant about not ALL vars are global.

I also don't know why you don't make a copy of the CMS user block with a new ID and use that with your own template file.

That's why it's a CMS!  



 
mort - View user's profile Send private message  
mort [ Thu 06 Sep, 2012 04:12 ]
Reply with quote    Download Post  
Post Re: Need Help Adding Link Variables 
 
mort wrote: [View Post]
Then you want something like this. (You will need to move things around, and add permissions and markup etc.)  

Spoiler: [ Show ]


Open forum.php
Spoiler: [ Show ]


Now you can see what I meant about not ALL vars are global.

I also don't know why you don't make a copy of the CMS user block with a new ID and use that with your own template file.

That's why it's a CMS!  


thanks, i am not use to phpbb i am use to smf so i am still learning with phpbb and icy phoenix.

can you also show me how to get the post count and user count and total topics count for template to show up?

somewhat like this:

Code: [Download] [Hide]
  1. Our users have posted a total of 28 articles 
  2. Total posts 19 • Total topics 19 
  3.  

and
i know the total posts and topics is from phpbb but i want to do something similar but with icyphoenix style of posts and topics.



 
juggalo_master - View user's profile Send private message  
juggalo_master [ Thu 06 Sep, 2012 07:24 ]
Display posts from previous:    

HideWas this topic useful?

Post new topic  Reply to topic  Page 1 of 2
Goto page 1, 2  Next
 




 


 

  cron