The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

PHP Variables

View previous topic View next topic Go down

Solved PHP Variables

Post by !_NICK_! on 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_!
Active Poster

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

Back to top Go down

Solved Re: PHP Variables

Post by !_NICK_! on 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?

!_NICK_!
Active Poster

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

Back to top Go down

Solved Re: PHP Variables

Post by kirk on 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

kirk
Forumaster

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

Back to top Go down

Solved Re: PHP Variables

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

I was looking at this, http://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_!
Active Poster

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

Back to top Go down

Solved Re: PHP Variables

Post by ElMuggs on 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!

ElMuggs
Forumember

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

http://wizardswb.forumotion.com

Back to top Go down

Solved Re: PHP Variables

Post by !_NICK_! on 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. http://help.forumotion.com/popup_help.forum?l=miscvars

!_NICK_!
Active Poster

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

Back to top Go down

Solved Re: PHP Variables

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

In this post: http://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.

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: PHP Variables

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

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

!_NICK_!
Active Poster

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

Back to top Go down

Solved Re: PHP Variables

Post by Mati on 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, http://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

Mati
Active Poster

Posts : 1873
Reputation : 281
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://elite-gaming.forumotion.net/

Back to top Go down

Solved Re: PHP Variables

Post by LGforum on 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?

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: PHP Variables

Post by Mati on 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...........

Mati
Active Poster

Posts : 1873
Reputation : 281
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://elite-gaming.forumotion.net/

Back to top Go down

Solved Re: PHP Variables

Post by LGforum on 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

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: PHP Variables

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

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

!_NICK_!
Active Poster

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

Back to top Go down

Solved Re: PHP Variables

Post by LGforum on 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.

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: PHP Variables

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

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

Mike
Hyperactive

Male Posts : 4242
Reputation : 466
Language : English, HTML, CSS
Location : Bozeman, Montana

Back to top Go down

Solved Re: PHP Variables

Post by Mati on 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.

Mati
Active Poster

Posts : 1873
Reputation : 281
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://elite-gaming.forumotion.net/

Back to top Go down

Solved Re: PHP Variables

Post by LGforum on 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
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: PHP Variables

Post by LGforum on 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.

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: PHP Variables

Post by !_NICK_! on 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!

!_NICK_!
Active Poster

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

Back to top Go down

Solved Re: PHP Variables

Post by LGforum on 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.

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: PHP Variables

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

Lol, thanks once more.

!_NICK_!
Active Poster

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

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum