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.
The forum of the forums
+2
kirk
!_NICK_!
6 posters

    PHP Variables

    !_NICK_!
    !_NICK_!
    Active Poster


    Male Posts : 1505
    Reputation : 69
    Language : English, HTML, and CSS
    Location : In the middle of no return.

    Solved PHP Variables

    Post by !_NICK_! January 17th 2012, 2:20 am

    How do you put the PHP Variables in the templates to make them show up?


    Last edited by !_NICK_! on January 19th 2012, 12:23 am; edited 1 time in total
    !_NICK_!
    !_NICK_!
    Active Poster


    Male Posts : 1505
    Reputation : 69
    Language : English, HTML, and CSS
    Location : In the middle of no return.

    Solved Re: PHP Variables

    Post by !_NICK_! January 17th 2012, 2:32 am

    How are they able to show your last visit on there? What codes in the templates do they use for that? It's says when you login, "Logged as Nick. Your last visit was on Sun Jan 15, 2012 10:30 pm."

    How's is able to do that in the templates if you can't use variables. I know the variable {LAST_VISIT_DATE} is the code for showing that, but I mean what's the whole code to be displayed for that or are there any others like that?
    kirk
    kirk
    Forumaster


    Male Posts : 11037
    Reputation : 653
    Language : English,Vulcan,Klingon, Romulan,& Gorn

    Solved Re: PHP Variables

    Post by kirk January 17th 2012, 2:32 am

    forumotion is not compatible with php.
    But depending what it is your trying to do there are most likely other ways you can get the same thing.

    what are you trying to incorporate?

    !_NICK_! wrote:How are they able to show your last visit on there? What codes in the templates do they use for that? It's says when you login, "Logged as Nick. Your last visit was on Sun Jan 15, 2012 10:30 pm."

    How's is able to do that in the templates if you can't use variables. I know the variable {LAST_VISIT_DATE} is the code for showing that, but I mean what's the whole code to be displayed for that or are there any others like that?

    What is it you are trying to do.
    Please explain what it is you want to do, then we can most likely help Smile
    !_NICK_!
    !_NICK_!
    Active Poster


    Male Posts : 1505
    Reputation : 69
    Language : English, HTML, and CSS
    Location : In the middle of no return.

    Solved Re: PHP Variables

    Post by !_NICK_! January 17th 2012, 2:39 am

    I was looking at this, https://help.forumotion.com/t48637- .

    I was going to make it display like this below

    Spoiler:

    I mean you see it works in this post, but it won't work in the templates. I don't understand that.
    ElMuggs
    ElMuggs
    Forumember


    Posts : 91
    Reputation : 17
    Language : CSS / HTML / BBcode / Javascript / Graphics and Tech Support yeech..
    Location : Deep in the belly of the code

    Solved Re: PHP Variables

    Post by ElMuggs January 17th 2012, 3:45 am

    The one to get the post count in templates is {NB_MESSAGES} (or at least that's the one I use in widgets) and Last Visit is {LAST_VISIT_DATE}

    I don't know what the one for the joined date is though.

    Hope it helps!
    !_NICK_!
    !_NICK_!
    Active Poster


    Male Posts : 1505
    Reputation : 69
    Language : English, HTML, and CSS
    Location : In the middle of no return.

    Solved Re: PHP Variables

    Post by !_NICK_! January 17th 2012, 4:12 am

    ElMuggs wrote:The one to get the post count in templates is {NB_MESSAGES} (or at least that's the one I use in widgets) and Last Visit is {LAST_VISIT_DATE}

    I don't know what the one for the joined date is though.

    Hope it helps!

    Sorry, {NB_MESSAGES} doesn't work. :'(

    *Edit* I also found something useful. https://help.forumotion.com/popup_help.forum?l=miscvars
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: PHP Variables

    Post by LGforum January 17th 2012, 6:49 am

    In this post: https://help.forumotion.com/t99575-username-in-templates#644570

    I display how to do it with the username variable. The same thing can be done for all the variables.
    !_NICK_!
    !_NICK_!
    Active Poster


    Male Posts : 1505
    Reputation : 69
    Language : English, HTML, and CSS
    Location : In the middle of no return.

    Solved Re: PHP Variables

    Post by !_NICK_! January 18th 2012, 2:52 am

    I tried that, but it didn't work. I seen that too.
    Mati
    Mati
    Active Poster


    Posts : 1932
    Reputation : 333
    Language : HTML, CSS & JavaScript
    Location : Forum Services

    Solved Re: PHP Variables

    Post by Mati January 18th 2012, 8:40 am

    Rideem3 wrote:You can't Wink
    The templates do not accept any of the PHP variables by Forumotion. Neither can JS Management.

    Of course you can just look at my forum Statistics. Very Happy

    !_NICK_! wrote:I was looking at this, https://help.forumotion.com/t48637- .

    I was going to make it display like this below

    Spoiler:

    I mean you see it works in this post, but it won't work in the templates. I don't understand that.

    NICK, please follow this tutorial http://forum.forumactif.com/t260631-astuce-utiliser-les-variables-user-et-forum-autre
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: PHP Variables

    Post by LGforum January 18th 2012, 10:00 am

    Nick, don't follow that tutorial, it's possibly the worst way of doing it. It uses Ajax just so, pointlessly.

    The post I gave you works fine, would you like to tell me what about it wasn't working?
    Mati
    Mati
    Active Poster


    Posts : 1932
    Reputation : 333
    Language : HTML, CSS & JavaScript
    Location : Forum Services

    Solved Re: PHP Variables

    Post by Mati January 18th 2012, 10:28 am

    LGforum wrote:Nick, don't follow that tutorial, it's possibly the worst way of doing it. It uses Ajax just so, pointlessly.

    The post I gave you works fine, would you like to tell me what about it wasn't working?

    What is wrong with it mate, i use that for my forum and is easy to use...........
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: PHP Variables

    Post by LGforum January 18th 2012, 10:39 am

    Just because something works doesn't mean it is good.
    Because Ajax makes a request to another page... almost the same as loading another page (not quite as bad but almost) ... also look at the size of the script. INFACT right now... I will write something which will do this for anyone...


    EDIT:
    This post was originally a mini explanation of how easy it is to do this without that horrible unneccessary script. It contained some codes to show the author what to do and how to do it.

    However I was so shocked that people were using that script just to move the information in a variable to templates that I had to write a tutorial/better explanation.

    So here: http://www.avacweb.com/t125-17-variable-in-html-pages-and-templates
    !_NICK_!
    !_NICK_!
    Active Poster


    Male Posts : 1505
    Reputation : 69
    Language : English, HTML, and CSS
    Location : In the middle of no return.

    Solved Re: PHP Variables

    Post by !_NICK_! January 18th 2012, 11:06 pm

    Username works, but user post count won't work.
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: PHP Variables

    Post by LGforum January 19th 2012, 12:02 am

    Thats because in the tutorial I spelt the Variable wrong. If you read the tutorial, you'll understand what you need to do to add your own variables to it to work. My tutorial will work for ALL the variables, all that is required is adding the Variable to the list within the DIV.
    Mike
    Mike
    Hyperactive


    Male Posts : 4255
    Reputation : 471
    Language : English, HTML, CSS
    Location : Loveland, Colorado

    Solved Re: PHP Variables

    Post by Mike January 19th 2012, 12:07 am

    There's a better one on the french forum.. that i use.
    Mati
    Mati
    Active Poster


    Posts : 1932
    Reputation : 333
    Language : HTML, CSS & JavaScript
    Location : Forum Services

    Solved Re: PHP Variables

    Post by Mati January 19th 2012, 12:10 am

    LGforum wrote:Thats because in the tutorial I spelt the Variable wrong.

    You always doing that for some reason. PHP Variables Redface
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: PHP Variables

    Post by LGforum January 19th 2012, 12:13 am

    Razz Am i? lol.

    ...I didn't know i was often spelling variables wrong. lol.

    I'd be intrigued to see that Drogba, because there's not many faster ways really.
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: PHP Variables

    Post by LGforum January 19th 2012, 12:21 am

    Yes you need to put the Javascript provided iin the tutorial into a Javascript... Like it says in the tutorial.

    EDIT: odd. The NICK deleted his post above this one. It was not a double post.
    !_NICK_!
    !_NICK_!
    Active Poster


    Male Posts : 1505
    Reputation : 69
    Language : English, HTML, and CSS
    Location : In the middle of no return.

    Solved Re: PHP Variables

    Post by !_NICK_! January 19th 2012, 12:22 am

    I did put the Javascript in there, just thought I had to add on to it.

    I think LGForum's way was easier and better.

    It worked. What I was doing wrong was adding the { and I didn't know I wasn't suppose to. Thanks!

    You to Matti!

    Solved!
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: PHP Variables

    Post by LGforum January 19th 2012, 12:23 am

    Thank you Nick. I'm glad you realised that haha.

    I'm glad you learnt how to work it.
    !_NICK_!
    !_NICK_!
    Active Poster


    Male Posts : 1505
    Reputation : 69
    Language : English, HTML, and CSS
    Location : In the middle of no return.

    Solved Re: PHP Variables

    Post by !_NICK_! January 19th 2012, 12:24 am

    Lol, thanks once more.

      Current date/time is November 11th 2024, 9:29 pm