Forum Moderators: coopster

Message Too Old, No Replies

Trying to edit php script and failing.

         

ska_demon

2:38 pm on Dec 8, 2005 (gmt 0)

10+ Year Member



I have directory script that I purchased. When it generates a page it includes the 'site name' field in the <keyword> tag. ('site_name' is the name of my website and this name is included in the keywords for every entry)As far as I can tell this is the line that does the business.

$en['keywords'] .= ', '.site_name.((int)e_cat!= 0? ', '.$ec_line[c_keywords].', '.$ec_line[c_name] : '');
if (substr($en['keywords'],0,2) == ', ') $en['keywords'] = substr($en['keywords'],2);
if (substr($en['description'],0,2) == ', ') $en['description'] = substr($en['description'],2);
define('keywords',$en['keywords']);

You can see the 'site_name' part which i believe adds my site name to the keywords. Now, my site name is irrelevant and I dont want it to appear. I tried deleting bits n bobs but i am just getting server errors. I dont do programming so you'll have to bear with me.

Can anyone suggest how I might remove the 'site_name' include without killing the site each time.

TIA

Ska

wheelie34

3:21 pm on Dec 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am also not a programer but try to remove the following ONLY, including both .(dots)

.site_name.

that should still run the rest, if not maybe coopster could correct me.

ska_demon

3:49 pm on Dec 8, 2005 (gmt 0)

10+ Year Member



I removed that part and a few variations on it. Trouble is I just get an error when I re-upload the file. Maybe it is linked to some other part of the entire directory script in some way which is preventing it from working.

I dunno

Thanks

Ska

ska_demon

4:01 pm on Dec 8, 2005 (gmt 0)

10+ Year Member



Ok I have it sussed.

Looks like i had to remove the entire first line of code,

$en['keywords'] .= ', '.site_name.((int)e_cat!= 0? ', '.$ec_line[c_keywords].', '.$ec_line[c_name] : '');

This now appears to list all the relevant keywords and leaves out my site name.

Thanks anyway

Ska

FalseDawn

6:53 pm on Dec 8, 2005 (gmt 0)

10+ Year Member



You don't have to remove the entire line - you will lose category keywords by doing this

$en['keywords'] .= ((int)e_cat!= 0? (', ' . $ec_line[c_keywords] . ', ' . $ec_line[c_name]) : '');

Should work (no need for the first comma, and I've bracketed the first expression set in the "?" operator to make it easier to see what's going on.

ska_demon

8:50 am on Dec 9, 2005 (gmt 0)

10+ Year Member



You guys are slick.

Thanks for your help.

Ska