Author Topic: [TWEAK] - Universal {url_filename} tag for includes/page_header.php file  (Read 21327 times)

0 Members and 1 Guest are viewing this topic.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
This is tweak for universal tag for {url_filename} . No more for need to go to includes/page_header.php file for add yourself. ;)

Find:

Quote
if (!empty($additional_urls)) {

add before:

Code: [Select]
// Auto-use of {url_filename} uppon PHP ROOT files detection in HTML template files.
        if (defined('ROOT_PATH') && @is_dir(ROOT_PATH) && @is_readable(ROOT_PATH)) {
            $files_array = array("categories.php", "config.php", "config.new.php", "details.php", "index.php", "lightbox.php", "login.php", "logout.php", "member.php", "captcha.php", "register.php", "search.php", "top.php", "global.php", "download.php", "rss.php", "postcards.php");
            $handle = @opendir(ROOT_PATH);
            while (false !== ($file = @readdir($handle))) {
                $content = @file_get_contents($file);
                if ($file != "." && $file != ".." && $file != $files_array[0] && $file != $files_array[1] && $file != $files_array[2] && $file != $files_array[3] && $file != $files_array[4] && $file != $files_array[5] && $file != $files_array[6]
                 && $file != $files_array[7] && $file != $files_array[8] && $file != $files_array[9] && $file != $files_array[10] && $file != $files_array[11] && $file != $files_array[12] && $file != $files_array[13]
                 && $file != $files_array[14] && $file != $files_array[15] && $file != $files_array[16]
                 && preg_match("/\.php$/", $file) && preg_match("/(.+)\.(.+)/", $file) && preg_match("/<[\?|%]+(php|=)?(.*)[\?|%]+>/siU", $content)) {
                    $file1 = substr($file, 0, -4);            
                    $site_template->register_vars("url_" . $file1, (@file_exists(ROOT_PATH . $file1 . ".php")) ? $site_sess->url(ROOT_PATH . get_file_name(basename($file))) : "");
                }                
            }
            @closedir($handle);
            unset ($files_array);
            unset ($handle);
         }

This is no affect core ROOT PHP files of 4images. If upload new PHP file in ROOT_PATH, you can use: {url_your_new_file} in HTML template. No PHP skill need for add URL tag in template now. ;)
« Last Edit: February 18, 2011, 02:32:30 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [TWEAK] - Universal {url_filename} tag for includes/page_header.php file
« Reply #1 on: October 14, 2007, 04:25:04 PM »
/* Fix */

- [10.14.2007]

Fix for <?php and ?> check in content.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [TWEAK] - Universal {url_filename} tag for includes/page_header.php file
« Reply #2 on: October 14, 2007, 05:47:33 PM »
You add before

Quote
if (!empty($additional_urls)) {

no after ? ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [TWEAK] - Universal {url_filename} tag for includes/page_header.php file
« Reply #3 on: October 14, 2007, 05:53:22 PM »
Ok, I just try with {url_banner} in home.html template and I create new file name banner.php in ROOT_PATH and I can see in template ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [TWEAK] - Universal {url_filename} tag for includes/page_header.php file
« Reply #4 on: October 14, 2007, 06:49:05 PM »
Quote
i use php 5.2.4

Ah ! is why. Please read my signature for this. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [TWEAK] - Universal {url_filename} tag for includes/page_header.php file
« Reply #5 on: October 14, 2007, 08:53:10 PM »
Quote
i have switched to php 4.x...
the same failure (blank line)

I no can create this ... install MODs ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [TWEAK] - Universal {url_filename} tag for includes/page_header.php file
« Reply #6 on: October 15, 2007, 12:35:24 AM »
I no get ... try on fresh server with PHP v4.4+ ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [TWEAK] - Universal {url_filename} tag for includes/page_header.php file
« Reply #7 on: October 15, 2007, 01:00:42 PM »
Please read last reply - try with fresh.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?