https://www.icyphoenix.com/viewtopic.php?f=36&t=8671 ----------------------------------- juggalo_master Tue 04 Sep, 2012 03:15 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 ----------------------------------- DWho Tue 04 Sep, 2012 09:48 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 linenumbers=false]'U_ABOUT' => append_sid(IP_ROOT_PATH . 'about.' . PHP_EXT),[/code] then open includes/functions.php and find [code linenumbers=false] 'L_PROFILE' => $lang['Profile'],[/code] after add [code linenumbers=false] 'L_ABOUT' => $lang['About'],[/code] finally open language/lang_english/lang_main.php (or your langage folder if different form english) find [code linenumbers=false] 'Profile' => 'Profile',[/code] add after [code linenumbers=false] 'About' => 'About', [/code] 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 :mrgreen: :mrgreen: ----------------------------------- TheSteffen Tue 04 Sep, 2012 10:31 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. ----------------------------------- mort Tue 04 Sep, 2012 12:45 Re: Need Help Adding Link Variables ----------------------------------- I was going to go this way. :mryellow: [b]Open:[/b] default.cfg [b]Find:[/b] ?> [b]Before Add:[/b] [code linenumbers=false]// 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[/code] Create a file: lang_extend_my_mods.php with the script below and copy it to your language folder. [code linenumbers=false] 'About', // END My Language ) ); ?> [/code] So now you have umpteen ways of doing it. :lol: ----------------------------------- Joshua203 Tue 04 Sep, 2012 13:21 Re: Need Help adding Link Variables ----------------------------------- [ot] I've edited all topic titles in this thread guys, juggalo_master please try using topic titles that describe the question... thanks :wink: PS.. GREAT info :mryellow: [/ot] ----------------------------------- juggalo_master Tue 04 Sep, 2012 14:05 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. ----------------------------------- mort Tue 04 Sep, 2012 14:22 Re: Need Help Adding Link Variables ----------------------------------- [quote user="juggalo_master" post="56642"]I was searching through files for like at least 2 hrs.[/quote] If you had something like [b]Notepad++[/b] you could have done it in 10 minutes! :P http://notepad-plus-plus.org/ :mryellow: ----------------------------------- DWho Tue 04 Sep, 2012 14:59 Re: Need Help Adding Link Variables ----------------------------------- Also use [url=http://www.wingrep.com/]Windows Grep will search through folders and files for the word you place into the search function... :mrgreen: :mrgreen: ----------------------------------- juggalo_master Wed 05 Sep, 2012 05:20 Re: Need Help Adding Link Variables ----------------------------------- [quote user="mort" post="56644"][quote user="juggalo_master" post="56642"]I was searching through files for like at least 2 hrs.[/quote] If you had something like [b]Notepad++[/b] you could have done it in 10 minutes! :P http://notepad-plus-plus.org/ :mryellow:[/quote] i don't like notepadd ++ it always destroy my designs. [quote user="DWho" post="56645"]Also use [url=http://www.wingrep.com/]Windows Grep will search through folders and files for the word you place into the search function... :mrgreen: :mrgreen:[/quote] 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 ----------------------------------- mort Wed 05 Sep, 2012 06:09 Re: Need Help Adding Link Variables ----------------------------------- Logged-in data Logged-Out data ----------------------------------- juggalo_master Wed 05 Sep, 2012 07:52 Re: Need Help Adding Link Variables ----------------------------------- [quote user="mort" post="56648"] Logged-in data Logged-Out data [/quote] 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. ----------------------------------- mort Wed 05 Sep, 2012 09:10 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. :mryellow: 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. :( ----------------------------------- juggalo_master Wed 05 Sep, 2012 14:10 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]

{AVATAR_IMG}

{U_NAME_LINK}
{LAST_VISIT_DATE}
{L_NEW_SEARCH}


{AVATAR_IMG}

{L_USERNAME}:

{L_PASSWORD}:


 {L_REMEMBER_ME}



{L_SEND_PASSWORD}

{L_REGISTER_NEW_ACCOUNT}

[/code] ----------------------------------- mort Thu 06 Sep, 2012 04:12 Re: Need Help Adding Link Variables ----------------------------------- Then you want something like this. [b][i](You will need to move things around, and add permissions and markup etc.)[/i][/b] :P [spoiler][code linenumbers=false]

{AVATAR_IMG}

 {U_NAME_LINK}
{LAST_VISIT_DATE} {PRIVATE_MESSAGE_INFO}
  Quick {L_LOGIN_LOGOUT}:  {L_USERNAME}:     {L_PASSWORD}:       {L_AUTO_LOGIN}    
[/code][/spoiler] Open forum.php [spoiler][code linenumbers=false] Find: $template->assign_vars(array( 'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts), Before Add: // Check For Anonymous User if ($user->data['user_id'] != ANONYMOUS) { $name_link = colorize_username($user->data['user_id'], $user->data['username'], $user->data['user_color'], $user->data['user_active']); $avatar_img = user_get_avatar($user->data['user_id'], $user->data['user_level'], $user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_allowavatar']); } else { $name_link = $lang['Guest']; $avatar_img = ''; } $template->assign_vars(array( 'U_NAME_LINK' => $name_link, ) ); [/code][/spoiler] 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! :mryellow: ----------------------------------- juggalo_master Thu 06 Sep, 2012 07:24 Re: Need Help Adding Link Variables ----------------------------------- [quote user="mort" post="56652"]Then you want something like this. [b][i](You will need to move things around, and add permissions and markup etc.)[/i][/b] :P [spoiler][code linenumbers=false]

{AVATAR_IMG}

 {U_NAME_LINK}
{LAST_VISIT_DATE} {PRIVATE_MESSAGE_INFO}
  Quick {L_LOGIN_LOGOUT}:  {L_USERNAME}:     {L_PASSWORD}:       {L_AUTO_LOGIN}    
[/code][/spoiler] Open forum.php [spoiler][code linenumbers=false] Find: $template->assign_vars(array( 'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts), Before Add: // Check For Anonymous User if ($user->data['user_id'] != ANONYMOUS) { $name_link = colorize_username($user->data['user_id'], $user->data['username'], $user->data['user_color'], $user->data['user_active']); $avatar_img = user_get_avatar($user->data['user_id'], $user->data['user_level'], $user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_allowavatar']); } else { $name_link = $lang['Guest']; $avatar_img = ''; } $template->assign_vars(array( 'U_NAME_LINK' => $name_link, ) ); [/code][/spoiler] 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! :mryellow:[/quote] 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] Our users have posted a total of 28 articles Total posts 19 • Total topics 19 [/code] 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. ----------------------------------- mort Thu 06 Sep, 2012 08:04 Re: Need Help Adding Link Variables ----------------------------------- You had better get used to looking and learning how to use the CMS, as the details you are after are in here. /blocks/statistics.php And please, stop quoting the post above yours (Or the last post), especially when they contain a lot of detail. Use the "Reply" button instead. Why? Because I have to go through all this in my quick-view mail-washer just to read your few lines at the bottom..... [spoiler][code linenumbers=false]Hello mort! juggalo_master has posted a new reply to "Need Help adding Link Variables" in the "Templates And Styles Discussions" forum at Icy Phoenix. You can use the following link to view the replies made (no more notifications will be sent until you visit the topic): http://www.icyphoenix.com/viewtopic.php?p=56654#p56654 Posted text: mort wrote: [View Post [links to #]] Then you want something like this. (You will need to move things around, and add permissions and markup etc.) [Image ignored] Spoiler: [ Show [links to #] ] Spoiler: [ Hide [links to #] ] Code: [Hide [links to #]] [Select [links to #]] Code: [Show [links to #]]

{AVATAR_IMG}

 {U_NAME_LINK}
{LAST_VISIT_DATE} {PRIVATE_MESSAGE_INFO}
  Quick {L_LOGIN_LOGOUT}:  {L_USERNAME}:     {L_PASSWORD}:       {L_AUTO_LOGIN}    
Open forum.php Spoiler: [ Show [links to #] ] Spoiler: [ Hide [links to #] ] Code: [Hide [links to #]] [Select [links to #]] Code: [Show [links to #]] Find: $template->assign_vars(array( 'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts), Before Add: // Check For Anonymous User if ($user->data['user_id'] != ANONYMOUS) { $name_link = colorize_username($user->data['user_id'], $user->data['username'], $user->data['user_color'], $user->data['user_active']); $avatar_img = user_get_avatar($user->data['user_id'], $user->data['user_level'], $user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_allowavatar']); } else { $name_link = $lang['Guest']; $avatar_img = ''; } $template->assign_vars(array( 'U_NAME_LINK' => $name_link, ) ); 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! [Image ignored] 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: [Hide [links to #]] Code: [Show [links to #]] * Our users have posted a total of 28 articles * Total posts 19 • Total topics 19 * 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. You are receiving this email because you are watching the forum, "Templates And Styles Discussions" forum at Icy Phoenix. If you no longer wish to watch this forum you can either click the "Stop watching this topic link" found at the bottom of the topic above, or by clicking the following link: http://www.icyphoenix.com/viewtopic.php?t=8671unwatch=topic [links to www.icyphoenix.com/viewtopic.php?t=8671&unwatch=topic] ____________ Icy Phoenix Staff No virus found in this message. Checked by AVG - www.avg.com [links to 'http://www.avg.com'] Version: 2012.0.2197 / Virus Database: 2437/5251 - Release Date: 09/05/12[/code][/spoiler] That's why! :mryellow: ----------------------------------- juggalo_master Thu 06 Sep, 2012 14:28 Re: Need Help Adding Link Variables ----------------------------------- oh ok. i will look and see if i can find what i am looking for. should really have a tutorial for new users on how to use the system specially for 2.0. i have copied this [code] 'TOTAL_USERS' => sprintf($l_total_user_s, $total_users), 'NEWEST_USER' => sprintf($lang['Newest_user'], '', $newest_user, ''), 'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts), 'TOTAL_TOPICS' => sprintf($lang['total_topics'], $total_topics), in the tpl file:
{TOTAL_USERS}
{NEWEST_USER}

{TOTAL_POSTS} {TOTAL_TOPICS}
[/code] into my php file and it still doesn't show up the posts and topics. is there something else i need? ----------------------------------- mort Thu 06 Sep, 2012 23:28 Re: Need Help Adding Link Variables ----------------------------------- You would possibly need to copy the SQL that queries the information for that data to your php file also. And you're right about the docs, but I don't think anyone has had the chance to catch up. :( ----------------------------------- juggalo_master Fri 07 Sep, 2012 03:45 Re: Need Help Adding Link Variables ----------------------------------- oh ok. couldn't i had a specific tag to show the information without using php or no? ----------------------------------- mort Fri 07 Sep, 2012 08:38 Re: Need Help Adding Link Variables ----------------------------------- No, You need to have a function that queries the database for the info, then you have to add vars to the queries, then you need to pass those vars to the template like this for example. [code linenumbers=false]$template->assign_vars(array( 'TOTAL_USERS' => sprintf($l_total_user_s, $total_users), 'NEWEST_USER' => sprintf($lang['Newest_user'], '', $newest_user, ''), 'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts), 'TOTAL_TOPICS' => sprintf($lang['total_topics'], $total_topics), ) );[/code] Then in your template you would have [b]{TOTAL_USERS}[/b] to pass the [b]$total_users[/b] query to the front-end etc. :mryellow: Welcome to phpBB code? :? And by the way, it's not something I bother with much any more [i](since Icy Phoenix has changed so dramatically from the last version and I don't want you to think I'm ignoring you)[/i], so you'll have to wait for an Icy Phoenix fanatic to assist you further. ----------------------------------- juggalo_master Fri 07 Sep, 2012 23:57 Re: Need Help Adding Link Variables ----------------------------------- i did that it didn't work the way i was hoping but i guess i will have to figure it out somehow. if i can take it from phpbb3 template and show it on icy i might be able to figure it out. i am guessing 2.0 just came out. ----------------------------------- mort Sat 08 Sep, 2012 01:48 Re: Need Help Adding Link Variables ----------------------------------- Yes, Version 2.* has just been released and is more or less still undergoing beta testing. I may have given you a bum steer too. :( [b]Try this:[/b] [b]Open:[/b] templates/default/default.cfg [b]Find:[/b] ?> [b]Before add:[/b] [code linenumbers=false]$template->assign_vars(array( 'TOTAL_USERS' => sprintf($l_total_user_s, $total_users), 'NEWEST_USER' => sprintf($lang['Newest_user'], '', $newest_user, ''), 'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts), 'TOTAL_TOPICS' => sprintf($lang['total_topics'], $total_topics), ) );[/code] [b]Template code:[/b] {TOTAL_USERS} {NEWEST_USER} {TOTAL_POSTS} {TOTAL_TOPICS} ----------------------------------- juggalo_master Sat 08 Sep, 2012 03:49 Re: Need Help Adding Link Variables ----------------------------------- i get this: The newest registered user is within topics this is all that shows nothing else when i use those codes. i tried the way you just mentioned. how would i go about doing it from a older version maybe i be able to get it to work that way by looking at the old way from the older versions and then convert it to 2.0. ----------------------------------- mort Sat 08 Sep, 2012 04:26 Re: Need Help Adding Link Variables ----------------------------------- It's all showing up for me? Do us a favour, Take a snapshot of your forum where you want to add this and add a sketch of what you are actually trying to do with all the details you want in it. Because at the moment it's like working in the dark as some vars, [i]as I explained before [/i]- don't work in all locations. :( ----------------------------------- juggalo_master Sat 08 Sep, 2012 08:06 Re: Need Help Adding Link Variables ----------------------------------- [img align=left]http://www.animenewsinc.net/jugg.png[/img] i am mostly wanting it to show up right in this block. i want to add the total posts, users, and topics on that section. btw the 1.4 million, 21, and 18 isn't my posts. i just started up this script like a few days ago. those arent the stats of the forum. ----------------------------------- mort Sat 08 Sep, 2012 08:26 Re: Need Help Adding Link Variables ----------------------------------- I'm no expert, but I just wasted far too much time trying to work out how IP is now put together. phpBB3 is something that never interested me [i](which is the way IP is going)[/i], and learning it is something I never wanted to get involved with - - So I'm out of it. :( ----------------------------------- Mighty Gorgon Sun 09 Sep, 2012 18:48 Re: Need Help Adding Link Variables ----------------------------------- Those informations are added to CACHE to avoid excessive MySQL charge. Here is how you can recall them: [codeblock] if (empty($config['max_topics']) || empty($config['max_posts']) || empty($config['max_users']) || empty($config['last_user_id'])) { board_stats(); } $total_topics = $config['max_topics']; $total_posts = $config['max_posts']; $total_users = $config['max_users']; $newest_user = $cache->obtain_newest_user();[/codeblock] Remember that you may need to add at least [c]global $db, $cache, $config;[/c] if you plan to use those info within a function. ----------------------------------- juggalo_master Sun 09 Sep, 2012 21:13 Re: Need Help Adding Link Variables ----------------------------------- thanks mg i was trying to figure out was how to do that. now maybe i be able to figure out how to do other things as well.