Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
Misha
Worker
Worker


Joined: Jul 30, 2006
Posts: 203
Location: McLean, VA

PostPosted: Tue May 22, 2007 11:32 am Reply with quote

I'm thinking of writing my own links module, cause I'm not happy with SEO unfriandly standard one.

Several SEO applications are able of producing html code for the links page, the challenge is to include this code as it is in a nuke module as include file.

So, the question is: will the following code found in theme.php do the trick?:

Code:
    $tmpl_file = "XXXX/XXXX/my_links.html";

    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;


Thanks, Misha

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6383

PostPosted: Tue May 22, 2007 12:52 pm Reply with quote

Funny you should mention that...I am looking into that, too, but the result is a while off.

Not sure this will do what you want. The purpose of the code you posted is to replace variables in a template file with data in PHP variables, then display the result. If your variables are defined and the template file contains references to those variables, this might work. But if the HTML is hard coded in the template file, there's no need to use this approach.

_________________
I google, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
Misha
PostPosted: Tue May 22, 2007 1:21 pm Reply with quote

No surprise the author of nukeSEO is looking into this Smile

As I realize after a year of struggling for traffic, nuke is SOOOOOOO seo unfriendly Sad

Anyways, thanks for explaining the code - I learn something every time I talk to you, guys. Very Happy

Any advice on what will do the trick for me? Ideally something like include statement? Cause I really don't want to take the pure html file and stuff it with quotes and slashes every time I add or remove a link.

Thanks, Misha
 
kguske
PostPosted: Wed May 23, 2007 3:09 pm Reply with quote

If you don't have any variables in the HTML, you could remove the eval and do something like:
Code:
    $tmpl_file = "XXXX/XXXX/my_links.html";

    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    print $r_file;
 
Misha
PostPosted: Wed May 23, 2007 6:05 pm Reply with quote

Thanks, Kevin Smile
It does not work without eval though, but works fine with it. Since my goal is just to have it working, I'm leaving this as it is.
 
Misha
PostPosted: Fri Aug 24, 2007 10:23 pm Reply with quote

Funny thing. Today I stumbled upon the code that makes me thinking I can just use include statement for this. Any thoughts before I give it a try?
 
Misha
PostPosted: Sun Aug 26, 2007 3:03 pm Reply with quote

Yep, it's confirmed. Simple include statement does the trick LOL.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©