FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Add a link to usercp.tmpl (How can I add a new SECTION)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Add a link to usercp.tmpl [message #39391] Fri, 19 October 2007 16:10 Go to next message
warc is currently offline  warc   United Kingdom
Messages: 7
Registered: July 2007
Karma: 0
Junior Member
Can someone please explain



{SECTION: usercp_lnk3}
{ROOT}?t=index&{DEF: _rsid}
{SECTION: END}

{SECTION: warc_home}<a class="UserControlPanel nw" href="http://www.warc.org.uk/">WARC HOME</a> 
{SECTION: END}

{SECTION: u_forum_search}<a class="UserControlPanel nw" href="http://www.warc.org.uk/">WARC HOME</a> ~ <a class="UserControlPanel nw" href="{TEMPLATE: usercp_lnk}"><img src="{THEME_IMAGE_ROOT}/top_search{DEF: img_ext}" alt="{MSG: search}" /> {MSG: search}</a>&nbsp;&nbsp;
{SECTION: END}

{SECTION: warc_home_2}<a class="UserControlPanel nw" href="{TEMPLATE: usercp_lnk}">XZXX<img src="{THEME_IMAGE_ROOT}/top_search{DEF: img_ext}" alt="{MSG: search}" /> {MSG: search}</a>&nbsp;&nbsp;
{SECTION: END}


I have modified my usercp.tmpl file and I would like to know how this section works.
If I add a link to u_forum_search it is OK but I would like to add a new section so I made "warc_home"
but "warc_home" and "warc_home_2" never display, how can I add a new section which will display, also what is "usercp_lk3", this does not display either?

It opens in the Comntrol Panel OK and compiles the template file when a change is made.

This is doubtless something basic in the way the templates work but I do not understand what I need to do.
Re: Add a link to usercp.tmpl [message #39398 is a reply to message #39391] Sun, 21 October 2007 15:51 Go to previous messageGo to next message
Ilia is currently offline  Ilia   
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You've created the sections correction, but you have not referenced them, which is why they don't show up. The forum simply does not know where to put them.

You need to add {TEMPLATE: warc_home} where ever you want this text to appear.


FUDforum Core Developer
Re: Add a link to usercp.tmpl [message #39476 is a reply to message #39391] Thu, 25 October 2007 20:59 Go to previous messageGo to next message
warc is currently offline  warc   United Kingdom
Messages: 7
Registered: July 2007
Karma: 0
Junior Member
Thanks but I am still a bit puzzled, I have looked again at usrcp.tmpl and it does not have any

sections headed {TEMPLATE: should I put this in another file if so which?

Thanks
Re: Add a link to usercp.tmpl [message #39478 is a reply to message #39476] Fri, 26 October 2007 03:22 Go to previous messageGo to next message
Ilia is currently offline  Ilia   
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
it has {SECTION} you can reference another section from an existing section using the TEMPLATE tag.

FUDforum Core Developer
Re: Add a link to usercp.tmpl [message #39533 is a reply to message #39478] Sat, 03 November 2007 10:46 Go to previous messageGo to next message
mennella is currently offline  mennella   Italy
Messages: 9
Registered: August 2007
Karma: 0
Junior Member
ok after reading this discussion and the notes in the on top post, about template
manipulation, now I'm able to insert a new link in the usercp.tmpl
but I want to know if is it possible to show the new link only when the user
is logged in, and not for every visitors

thanks
Giuseppe Mennella
Re: Add a link to usercp.tmpl [message #39535 is a reply to message #39391] Sat, 03 November 2007 15:18 Go to previous messageGo to next message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma: 0
Senior Member
{IF: $is_u}blah blah{ENDIF}

I _think_, don't remember by heart.


Re: Add a link to usercp.tmpl [message #39543 is a reply to message #39533] Sun, 04 November 2007 15:50 Go to previous messageGo to next message
Ilia is currently offline  Ilia   
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
{IF _uid} your link {ENDIFI}

FUDforum Core Developer
Re: Add a link to usercp.tmpl [message #39567 is a reply to message #39391] Wed, 07 November 2007 11:56 Go to previous messageGo to next message
Dustin Kowalski is currently offline  Dustin Kowalski   United Kingdom
Messages: 62
Registered: August 2006
Location: Leicester
Karma: 0
Member
Thanks to everyone for their contributions in this thread. I had (quite literally and honestly) been tinkering with the templates to work out how to do this on my own site before chancing upon this thread because it happened to be below one of mine.

Quite the happy coincidence for me Smile
Re: Add a link to usercp.tmpl [message #40237 is a reply to message #39391] Sun, 27 January 2008 12:40 Go to previous messageGo to next message
Dustin Kowalski is currently offline  Dustin Kowalski   United Kingdom
Messages: 62
Registered: August 2006
Location: Leicester
Karma: 0
Member
OK, one of the members on this site PM'd me to ask whether I had understood what was written here and whether I'd successfully implemented the changes.

I'm not a computer-minded person either, and lots of the comments, suggestions, and instructions fly over my head when they come from people who are professionals in the field, so I'll write a layman's version of how I successfully make changes when I manage to.


In this case, I wanted to add two items to the user control panel (the links that scroll across the top of the page for private messaging, members, and so on).

I wanted to add something saying "Jebsite" which would link to my homepage, and another reading "Vortaroj" (Esperanto for "dictionaries") which would take me to a separate page.

Here's the finished version:

index.php?t=getfile&id=4039&private=0

To do this you need to:

1) Visit usercp.tmpl and select usercp.

The default looks like this:

<div class="UserControlPanel">{TEMPLATE-DATA: private_msg} {IF: ($FUD_OPT_1 & 8388608 || (_uid && $FUD_OPT_1 & 4194304) || $usr->users_opt & 1048576)}{TEMPLATE: member_search}{ENDIF} ... 


2) Amend this to include the name of something that you wish to add. In my case, I was going to add two things. I'm going to call them "jebsite" and "dictionaries".

The first line of usercp.tmpl now looks like this:

<div class="UserControlPanel">{TEMPLATE: jebsite}  {TEMPLATE: dictionaries}  {TEMPLATE-DATA: private_msg} {IF: ($FUD_OPT_1 & 8388608 || ... 


3) All the forum knows so far is to display the new things; you need to tell it what "jebsite" and "dictionaries" are.

To do this, go to "file manager", head to the relevant theme folder, and download the file usercp.tmpl.

Open this with WordPad, Notepad or whatever.

You'll notice that lots of familiar things are individually referenced between [SECTION] tags, such as "login". This is where the computer visits to get the details of the shorthand {TEMPLATE-DATA: private_msg} that was displayed when you displayed usercp.tmpl.

So now follow the lead and add the details for whatever you're adding. My jebsite link looks like:

{SECTION: jebsite}<a class="UserControlPanel nw" href="http://www.jeb.org.uk/" target="_blank"><img src="{THEME_IMAGE_ROOT}/jebsiteLogo.png" alt="Jebsite" /> Jebsite</a>&nbsp;&nbsp; {SECTION: END}


4) Save this and put it back where you got it from.

5) Visit your forum to verify that it's working.

6) Repeat this for your other themes.


That's how I did it. I hope that this may be of use to someone else who, like me, is not very experienced with computers.
  • Attachment: adpanel.jpg
    (Size: 64.68KB, Downloaded 1331 times)
Re: Add a link to usercp.tmpl [message #40238 is a reply to message #39391] Sun, 27 January 2008 13:28 Go to previous messageGo to next message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma: 0
Senior Member
You don't have to add a subtemplate to add a link really, you could have just inserted the link directly into usercp.tmpl -> usercp.

Re: Add a link to usercp.tmpl [message #40239 is a reply to message #40238] Sun, 27 January 2008 14:26 Go to previous message
Dustin Kowalski is currently offline  Dustin Kowalski   United Kingdom
Messages: 62
Registered: August 2006
Location: Leicester
Karma: 0
Member
I think the problem that I had there was that the space between the image and the text was underlined (so had the formatting effects) when I hovered over it. When you do that to the other (sub-templated) ones, this doesn't happen.

I didn't want it to look out of place, which it did when the added link wasn't behaving like the other links that were already there.

To get around this, I created the sub-templates to mimic the behaviour of those that I was trying to emulate, and it worked.

So yes, you can just add the link (which is how I had it before) but there is that slight negative drawback when you do take that approach.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Paid support for fixing voting on Fudforum
Next Topic: Changing user's email address
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Dec 30 16:12:27 GMT 2024

Total time taken to generate the page: 0.02147 seconds