Can link variables ({U_LOGIN_LOGOUT}) be used from an xml fi

Discuss the development of future releases of phpBB (phpBB 3.x minor releases) and MODing/Coding related questions.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
User avatar
Frost
New member
New member
Posts: 39
Joined: 24 Mar 2007, 12:53
Location: root/Italy
Contact:

Can link variables ({U_LOGIN_LOGOUT}) be used from an xml fi

Postby Frost » 02 Jul 2007, 07:10

Hello again,

I was wondering if there was a way to be able to use standard link variables such as {U_LOGIN_LOGOUT} in an xml file that is inside a template.

The idea behind this, is a flash menu that can be changed by a user of a style at any point. I realize that not everyone will want the same menu words and that I want to be able to use the variable to show how many messages a member has in a flash button.

The style I'm constructing can be seen here: http://www.dark-frost.com along with the basic menu so far.

I've made the menu editable through an xml file that is also inside the style theme folder, but I cannot get it to read the variables.
Any idea?

User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Can link variables ({U_LOGIN_LOGOUT}) be used from an xm

Postby igorw » 02 Jul 2007, 11:50

Hi,

can you please explain what you mean with "an xml file that is inside a template". How is it inside? How is it used?

Thanks ;)

Also a tipp, you can define template variables yourself inside the template, using <!-- DEFINE varname value --> afaik.

- we're poor!

User avatar
Frost
New member
New member
Posts: 39
Joined: 24 Mar 2007, 12:53
Location: root/Italy
Contact:

Re: Can link variables ({U_LOGIN_LOGOUT}) be used from an xm

Postby Frost » 03 Jul 2007, 17:43

Hey,

The xml file is read by the flash menu for basic structure and values of specific functions, IE: width, height, link, alt text etc.
What I mean by inside the template, is that it's placed inside the style folder.

I thought it would be fine because it was read from within the template folder itself, but apparently it's not the "index" page so the variables need to be defined all over again.

Can you give an example of how the variable can be defined? like <!-- DEFINE {SOMETHING_LIKE_THIS} Url or something --> ?

Or if you know of any documentation that shows this? I have never heard of being able to do this, but if it's possible it would answer MANY questions for new functionality in styles :D

User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Can link variables ({U_LOGIN_LOGOUT}) be used from an xm

Postby igorw » 03 Jul 2007, 18:03

Oooh, that's not so easy. The css files that also contain such variables are parsed by PHP first and then sent to the client. So you would have to parse it per PHP, output it, and then read the parsed output via HTTP, which is rather complicated, but it might work.

What you would have to do is create a page that is integrated into phpBB, and then parse the XML file per it's template system.

- we're poor!

User avatar
Frost
New member
New member
Posts: 39
Joined: 24 Mar 2007, 12:53
Location: root/Italy
Contact:

Re: Can link variables ({U_LOGIN_LOGOUT}) be used from an xm

Postby Frost » 03 Jul 2007, 18:12

Ahh, what I feared :(

I never thought xml would work, but it would have been cool to give them a choice, I guess I will just stick to a basic menu, and if they want a new one they can request it.

Anyway, more on the self defined variables. After thinking on it, the only way I can see this working would be something like this right?

define('MY_OWN_LINK', 'http://www.mysite.com/'); in a standard include
<!-- DEFINE('MY_OWN_LINK', 'http://www.mysite.com/') -->

Or am I dreaming?

User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Can link variables ({U_LOGIN_LOGOUT}) be used from an xm

Postby igorw » 03 Jul 2007, 18:21


- we're poor!

User avatar
Frost
New member
New member
Posts: 39
Joined: 24 Mar 2007, 12:53
Location: root/Italy
Contact:

Re: Can link variables ({U_LOGIN_LOGOUT}) be used from an xm

Postby Frost » 05 Jul 2007, 21:27


User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Can link variables ({U_LOGIN_LOGOUT}) be used from an xm

Postby igorw » 06 Jul 2007, 08:53

In phpBB3, that's $user->ip :)

- we're poor!

User avatar
Frost
New member
New member
Posts: 39
Joined: 24 Mar 2007, 12:53
Location: root/Italy
Contact:

Re: Can link variables ({U_LOGIN_LOGOUT}) be used from an xm

Postby Frost » 07 Jul 2007, 11:37

Is there one that will show the IP of the poster?

The one above shows each user their own IP...

So in viewtopic, under each user's information is it possible to have the ip of that member show?

Like this

Frost
Registered User
IP: 12.12.12.12

eviL<3
Admin
IP: 23:23:23:23

Other Member
Registered User
IP: 34:34:34:34

User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Can link variables ({U_LOGIN_LOGOUT}) be used from an xm

Postby igorw » 07 Jul 2007, 12:22

Yes, but this is saved on per-post basis, so you'd have to do an SQL query on the posts table.

- we're poor!

User avatar
Frost
New member
New member
Posts: 39
Joined: 24 Mar 2007, 12:53
Location: root/Italy
Contact:

Re: Can link variables ({U_LOGIN_LOGOUT}) be used from an xm

Postby Frost » 07 Jul 2007, 23:33

Do you know of a place where I can learn how to do that?

I generally know how, and what files, but still not good enough to write it myself off the top of my head.
Should I just look at mcp.php for the details area and copy and paste until I get it right?

User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Can link variables ({U_LOGIN_LOGOUT}) be used from an xm

Postby igorw » 09 Jul 2007, 07:46


- we're poor!

User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Can link variables ({U_LOGIN_LOGOUT}) be used from an xm

Postby igorw » 09 Jul 2007, 07:51


- we're poor!


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “phpBB Development discussion”

Who is online

Users browsing this forum: No registered users and 26 guests