How can I add a variable in a template? Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
3 posters

    How can I add a variable in a template?

    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved How can I add a variable in a template?

    Post by Van-Helsing Sat 11 Oct - 13:40

    Hello,
    How can I add the username variable in index_box template. I am trying this code
    Code:
    <li id="user_content"><a href="/st/{USERNAME}" title="">Οι δημοσιεύσεις μου</a>

    but its not working. Can you help me please?

    My forum version is PunBB.


    Last edited by Black-Shadow on Sat 11 Oct - 22:11; edited 1 time in total
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: How can I add a variable in a template?

    Post by _Twisted_Mods_ Sat 11 Oct - 14:45

    think you have to devide it like this


    Code:
    <li id="user_content"><a href="'/st/' + '{USERNAME}'" title="">Οι δημοσιεύσεις μου</a>
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I add a variable in a template?

    Post by Van-Helsing Sat 11 Oct - 20:35

    thetwistedkilla wrote:think you have to devide it like this


    Code:
    <li id="user_content"><a href="'/st/' + '{USERNAME}'" title="">Οι δημοσιεύσεις μου</a>
    Hello,
    Its not working it returns white page http://prntscr.com/4v73cw as you can see here now it adds the characters ' ' in url address http://prntscr.com/4v73wi normally it must goes to the link <forumurl>/st/username but its not adds the username at the end of the link.
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: How can I add a variable in a template?

    Post by Ange Tuteur Sat 11 Oct - 21:39

    Hello Black-Shadow,

    From what I recall, you cannot use this variable in the templates. You could try this :
    Code:
    <a id="search-t" href="/st/" title="">Οι δημοσιεύσεις μου</a><script type="text/javascript">$(function(){document.getElementById('search-t').href = '/st/' + _userdata.username});</script>
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I add a variable in a template?

    Post by Van-Helsing Sat 11 Oct - 21:53

    Hello Ange,
    The /spa/ is for member's replies and /st/ is for member's topics?
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: How can I add a variable in a template?

    Post by Ange Tuteur Sat 11 Oct - 22:05

    st = member's topics
    sta = topics member has posted in
    spa = member's replies
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I add a variable in a template?

    Post by Van-Helsing Sat 11 Oct - 22:10

    Thank you very much Ange its solved Smile .
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: How can I add a variable in a template?

    Post by Ange Tuteur Sat 11 Oct - 22:15

    You're welcome ^^

    Topic archived

    Have a great day. Smile