I would like to add my own text to each of these footer_links

I would like to add my own text to each of these footer_links

my site has categories, and each of these categories are displayed at the bottom of the main page in the footer.

http://trade-th.com/

eg: Vehicles | Cars | Motorcycles

I would like to add “My Text” in front each of these footer links, can it be done ? (“My Text” are the same words in all cases)

My Text Vehicles | My Text Cars | My Text Motorcycles

from the int.php file I have the code:

$footer_links=$categ->makeFooterLinks();

and

$smarty->assign(“footer_links”,$footer_links);

I am not sure if this code helps.

All help greatly appreciated :slight_smile:

Hi Ray,

From your previous thread, it seems that $footer_links contains all the text and HTML as a single string, which would be difficult to work with. Do you know where the makeFooterLinks() method is defined? Probably your best bet is to alter that, to add your custom text to each link as it generates the string.

Hi fretburner, thank you for your reply :slight_smile: I did a search for makeFooterLinks() in every file used in my site and only one result - util.php

So the words makeFooterLinks() appear in only one file the util.php

The code in that util.php is:

// footer categories links
if($appearance_settings[‘show_footer_categ’]==1) {

	global $config_footer_categ_len;

	$footer_links=$categ->makeFooterLinks();
	$smarty->assign("footer_links",$footer_links);
}

Please point me in the right direction if you need more info/code,

Your help greatly appreciated :slight_smile:

In the util.php file, have a look for where $categ is defined… you should see something like this:

$categ = new ...

makeFooterLinks is a method on a class somewhere - if you can find out the name of the class, you can look for the class file and that’s probably where you’ll find the code for makeFooterLinks.

Hi fretburner, good to hear from you, thank you :slight_smile:

ok yes in the same util.php file I found:

    global $short_categories;
$categ = new categories();
$short_categories=$categ->getAllOptions();
$smarty->assign("categories",$short_categories);

I am happy to PM you the complete util.php file if that would help,

I may not reply till tomorrow now as evening/dinner time here :slight_smile:

Hi fretburner, good to hear from you, thank you

ok yes in the same util.php file I found:

global $short_categories;
$categ = new categories();
$short_categories=$categ->getAllOptions();
$smarty->assign(“categories”,$short_categories);

does this help ? :slight_smile:

Hey Ray,

Try looking for the file with the categories class definition… try looking for a folder called classes and see if there’s a categories.php file inside.

Hi fretburner, thank you for your reply :slight_smile: yes found the folder called classes, and the categories.php, and here is the code:

<?php //0035e
if(!extension_loaded(‘ionCube Loader’)){$__oc=strtolower(substr(php_uname(),0,3));$_ln='/ioncube/ioncube_loader’.$__oc.‘_’.substr(phpversion(),0,3).(($__oc==‘win’)?‘.dll’:‘.so’);$__oid=$__id=realpath(ini_get(‘extension_dir’));$__here=dirname(FILE);if(strlen($__id)>1&&$__id[1]==‘:’){$__id=str_replace(‘\\’,‘/’,substr($__id,2));$__here=str_replace(‘\\’,‘/’,substr($__here,2));}$__rd=str_repeat(‘/…’,substr_count($__id,‘/’)).$__here.‘/’;$__i=strlen($__rd);while($__i–){if($__rd[$__i]==‘/’){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp;break;}}}@dl($__ln);}else{die(‘The file ‘.FILE." is corrupted.
");}if(function_exists(’_il_exec’)){return _il_exec();}echo(‘Site error: the file <b>’.FILE.‘</b> requires the ionCube PHP Loader ‘.basename($__ln).’ to be installed by the site administrator.’);exit(199);
?>
4+oV52OVZIpYf7K3x+eO3pKstjNlNOeat9eIykKs+vVxjHlI0veWtUZhRLyYXKJMim1hXCPiL+yM

Hi fretburner, thank you for your reply yes found the folder called classes, and the categories.php, and here is the code:

<?php //0035e
if(!extension_loaded(‘ionCube Loader’)){$__oc=strtolower(substr(php_uname(),0,3));$_ln='/ioncube/ioncube_loader’.$__oc.‘_’.substr(phpversion(),0,3).(($__oc==‘win’)?‘.dll’:‘.so’);$__oid=$__id=realpath(ini_get(‘extension_dir’));$__here=dirname(FILE);if(strlen($__id)>1&&$__id[1]==‘:’){$__id=str_replace(‘\\’,‘/’,substr($__id,2));$__here=str_replace(‘\\’,‘/’,substr($__here,2));}$__rd=str_repeat(‘/…’,substr_count($__id,‘/’)).$__here.‘/’;$__i=strlen($__rd);while($__i–){if($__rd[$__i]==‘/’){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp;break;}}}@dl($__ln);}else{die(‘The file ‘.FILE." is corrupted.
");}if(function_exists(’_il_exec’)){return _il_exec();}echo(‘Site error: the file <b>’.FILE.‘</b> requires the ionCube PHP Loader ‘.basename($__ln).’ to be installed by the site administrator.’);exit(199);
?>
4+oV52OVZIpYf7K3x+eO3pKstjNlNOeat9eIykKs+vVxjHlI0veWtUZhRLyYXKJMim1hXCPiL+yM

Hmm, the file has been encoded with ionCube, which is basically to stop people being able to read or modify the code, so there’s not much we can do here. The only option it leaves us is to try and modify the output from makeFooterLinks.

In utils.php, try doing this:


$footer_links = $categ->makeFooterLinks();
$footer_links = str_replace('">', '">My Text ', $footer_links);
$smarty->assign("footer_links",$footer_links);

This should prepend 'My Text ’ to the text of each of the links.

Hi fretburner, thank you for your reply, and THANK YOU for the perfect code! yes that prepends text to each link :slight_smile:

I am not sure I like the result visually as the links now all align to the left, if you look at http://trade-th.com/

Is there any code that could tidy these links ?

your help greatly appreciated :slight_smile:

Hi fretburner, I have improved the link layout by adding the <center> code, what else can be done ?

<h3 id=“footer_categories”><center>{$footer_links}</center></h3>

your help greatly appreciated :slight_smile:

Hey Ray,

The $footer_links string has line breaks hard coded in, and now that you’re prepending some text to each link the lines are longer and look odd when they wrap. You might want to try this and see if you prefer the look:


$footer_links = $categ->makeFooterLinks();
$footer_links = str_replace('">', '">My Text ', $footer_links);
$footer_links = str_replace('<br />', ' | ', $footer_links);
$smarty->assign("footer_links",$footer_links);

I would avoid using the <center> tag, as it’s a depreciated tag, and it’s better to use CSS to center text. It’s also better not to wrap the footer links in a <h3> tag, as it’s not a heading and I’m guessing you’re doing it for styling purposes, in which case again it’s better to use CSS.

<div id="footer_categories">{$footer_links}</div>

and in your css file:

#footer_categories {
    color: rgb(77, 80, 89);
    margin-top: 10px;
    line-height: 17px;
    /* add the lines below */
    padding: 0px 50px;
    font-size: 120%;
    font-family: "Trebuchet MS",verdana,arial,sans-serif;
    font-weight: bold;
}

You’ll probably want to play around with the padding to get it looking the way you want.

Hi fretburner, Thank you :slight_smile: Thank you :slight_smile: all your generous, and greatly appreciated code implemented and looking great :slight_smile:

I changed the footer links to h4 <h4 id=“footer_categories”>{$footer_links}</h4>

As the purpose of this exercise was to add an h2 to my page, and add prepending text to the footer links, all for SEO purposes, hoping it will help :slight_smile:

{if $appearance.show_footer_categ}
<h2 style=“font-size:14px;color:#4D5059;”><center><b>My Text</b></center></h2>
<h4 id=“footer_categories”>{$footer_links}</h4>
<!-- end: #footer_categories –>

Thank you again fretburner for your brilliant generosity :slight_smile: