PDA

View Full Version : Site Map Code


Warmbells
12-13-2004, 01:35 PM
Hi,

I have been looking at the thread on the site map code by Charter as I am very new to PHP I'm not sure where word wraps are appearing in the code on the forum, would it be possible for someone to email me a copy of the code as it should be?

Gerald
ged DOT bee AT virgin DOT net

Thanks

vinyl-junkie
12-13-2004, 06:42 PM
I'm thinking that you may actually not have a problem with word wrapping, due to the most recent upgrade of vBulletin, this forum's software. It now creates scrollable text boxes for code so that word wrapping probably isn't a problem. I'd be happy to verify that for you though if you can post a link to the thread you're referring to.

Warmbells
12-14-2004, 06:54 AM
Thanks

The thread I was looking at is at http://www.phpdig.net/forum/showthread.php?t=699

Gerald

Charter
12-14-2004, 12:42 PM
Just highlight the code, and then copy-paste into a text editor to save.

Warmbells
12-14-2004, 01:51 PM
Thanks,

It runs on for me but I get the following errors

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/warmbell/public_html/site-map.php on line 27
Sitemap


Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/warmbell/public_html/site-map.php on line 29

any ideas?

Charter
12-14-2004, 02:01 PM
Make sure define('PHPDIG_DB_PREFIX','prefix'); matches what is in the PhpDig connect.php file.

Warmbells
12-14-2004, 02:26 PM
Thanks again,

Working okay now, I won't have to do a seperate sitemap anymore, just one thing is it possible for the text shown (page title?) to be more than about 23 characters as the page titles are truncated such as

The duck pond at ...
Membership Applic...
Home Page of Anim...

Thanks for a terrific program

Gerald

Charter
12-14-2004, 02:49 PM
Replace:

if (strlen($words[0]) > 20) {
$part_words = substr($words[0],0,17)."...";
}
else {
$part_words = $words[0];
}

With:

$part_words = $words[0];

Warmbells
12-15-2004, 02:30 PM
As it is working okay for me now I have just one more question, how would I insert it into an html page so that it would look like it was part of the site? I would like it to look like the site search page is at the moment http://www.animals-in-distress.net/site_search.htm

Gerald

vinyl-junkie
12-15-2004, 05:55 PM
Are you asking how to add a phpdig search to another web page? If so, have a look at post #8 in this thread (http://www.phpdig.net/forum/showthread.php?t=839).

Warmbells
12-16-2004, 12:42 AM
No, I want to add a site map based on the database the code is working okay but I'm not sure how to take my site template and then call the site map php code to display in the middle of the page. I know I'll have to remove the <html><body> and </body></html> tags from charters code but I'm so new I'm foxed as to what to do next.

Gerald