4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 21, 2019, 05:08:14 AM

Login with username, password and session length
Search:     Advanced search
Check the new Tutorial subforum with helpfull guides and tutorials for modifications and tweaks.
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support)
| | |-+  Tutorials (Moderators: mawenzi, Rembrandt)
| | | |-+  [TUT] Add a url-variable like {url_yourlink}
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
This topic has not yet been rated!
Author Topic: [TUT] Add a url-variable like {url_yourlink}  (Read 8465 times)
Full Member
Offline Offline

Posts: 196

Thank You
-Given: 0
-Receive: 8

View Profile
« on: September 16, 2013, 06:52:38 PM »


as you maybe know, you can add different types of variables in your template files.
One type are the url-Variables.

If you want to add a link to different sites, it's useful to write a variable instead of the whole link.
It's much easier to edit this link, if something has changed. You only have to change the link in one file instead in every template file where you added the link.

This MOD will show you how to add this Variable.

Step 1  Arrow Open the template files where you want to add a link.

Step 2  Arrow Add the following anywhere to show the link:

<a href="{url_yourlink}">Yourlink-text</a>

Step 3.1  Arrow Open includes/page_header.php and search:

  "url_new_images" => $site_sess->url(ROOT_PATH."search.php?search_new_images=1"),

add below:

  "url_yourlink" => $site_sess->url(ROOT_PATH."yourlink-url"),

  Step 3.2  Arrow How to add the link url:
If you want to link to a file which is in your 4images directory:

  "url_yourlink" => $site_sess->url(ROOT_PATH."yourlink-url"),

for example:

  "url_yourlink" => $site_sess->url(ROOT_PATH."search.php"),

or with subfolders:

  "url_yourlink" => $site_sess->url(ROOT_PATH."admin/index.php"),

That was it already Wink

4images Guru
Offline Offline

Posts: 4187

Thank You
-Given: 116
-Receive: 900


View Profile WWW
« Reply #1 on: September 16, 2013, 07:19:32 PM »

Thank You!  Good

mfg Andi

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite

Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.091 seconds with 21 queries.
Post your comments here