Last edited by !_NICK_! on January 19th 2012, 12:23 am; edited 1 time in total
+2
kirk
!_NICK_!
6 posters
PHP Variables
!_NICK_!- Active Poster
- Posts : 1505
Reputation : 69
Language : English, HTML, and CSS
Location : In the middle of no return.
- Post n°1
PHP Variables
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_!- Active Poster
- Posts : 1505
Reputation : 69
Language : English, HTML, and CSS
Location : In the middle of no return.
- Post n°2
Re: PHP Variables
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?
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- Forumaster
- Posts : 11037
Reputation : 653
Language : English,Vulcan,Klingon, Romulan,& Gorn
- Post n°3
Re: PHP Variables
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?
What is it you are trying to do.
Please explain what it is you want to do, then we can most likely help
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
!_NICK_!- Active Poster
- Posts : 1505
Reputation : 69
Language : English, HTML, and CSS
Location : In the middle of no return.
- Post n°4
Re: PHP Variables
I was looking at this, https://help.forumotion.com/t48637- .
I was going to make it display like this below
I mean you see it works in this post, but it won't work in the templates. I don't understand that.
I was going to make it display like this below
- Spoiler:
- Nick your statistics are Posts: 0 | Joined: | Last Visit:
I mean you see it works in this post, but it won't work in the templates. I don't understand that.
ElMuggs- Forumember
- Posts : 91
Reputation : 17
Language : CSS / HTML / BBcode / Javascript / Graphics and Tech Support yeech..
Location : Deep in the belly of the code
- Post n°5
Re: PHP Variables
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!
I don't know what the one for the joined date is though.
Hope it helps!
!_NICK_!- Active Poster
- Posts : 1505
Reputation : 69
Language : English, HTML, and CSS
Location : In the middle of no return.
- Post n°6
Re: PHP Variables
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- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
- Post n°7
Re: PHP Variables
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.
I display how to do it with the username variable. The same thing can be done for all the variables.
!_NICK_!- Active Poster
- Posts : 1505
Reputation : 69
Language : English, HTML, and CSS
Location : In the middle of no return.
- Post n°8
Re: PHP Variables
I tried that, but it didn't work. I seen that too.
Mati- Active Poster
- Posts : 1932
Reputation : 333
Language : HTML, CSS & JavaScript
Location : Forum Services
- Post n°9
Re: PHP Variables
Rideem3 wrote:You can't
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.
!_NICK_! wrote:I was looking at this, https://help.forumotion.com/t48637- .
I was going to make it display like this below
- Spoiler:
Nick your statistics are Posts: 0 | Joined: | Last Visit:
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- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
- Post n°10
Re: PHP Variables
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?
The post I gave you works fine, would you like to tell me what about it wasn't working?
Mati- Active Poster
- Posts : 1932
Reputation : 333
Language : HTML, CSS & JavaScript
Location : Forum Services
- Post n°11
Re: PHP Variables
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- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
- Post n°12
Re: PHP Variables
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
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_!- Active Poster
- Posts : 1505
Reputation : 69
Language : English, HTML, and CSS
Location : In the middle of no return.
- Post n°13
Re: PHP Variables
Username works, but user post count won't work.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
- Post n°14
Re: PHP Variables
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- Hyperactive
- Posts : 4255
Reputation : 471
Language : English, HTML, CSS
Location : Loveland, Colorado
- Post n°15
Re: PHP Variables
There's a better one on the french forum.. that i use.
Mati- Active Poster
- Posts : 1932
Reputation : 333
Language : HTML, CSS & JavaScript
Location : Forum Services
- Post n°16
Re: PHP Variables
LGforum wrote:Thats because in the tutorial I spelt the Variable wrong.
You always doing that for some reason.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
- Post n°17
Re: PHP Variables
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.
...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- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
- Post n°18
Re: PHP Variables
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.
EDIT: odd. The NICK deleted his post above this one. It was not a double post.
!_NICK_!- Active Poster
- Posts : 1505
Reputation : 69
Language : English, HTML, and CSS
Location : In the middle of no return.
- Post n°19
Re: PHP Variables
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!
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- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
- Post n°20
Re: PHP Variables
Thank you Nick. I'm glad you realised that haha.
I'm glad you learnt how to work it.
I'm glad you learnt how to work it.
!_NICK_!- Active Poster
- Posts : 1505
Reputation : 69
Language : English, HTML, and CSS
Location : In the middle of no return.
- Post n°21
Re: PHP Variables
Lol, thanks once more.