Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
5 + 8 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     
getAllCats('access'); if(count($categories)>0) foreach ($categories as $key=>$category){$cat_id=$category->getVar("cat_id"); $i=$cat_id; $sitemap['parent'][$i]['id'] = $cat_id; $sitemap['parent'][$i]['title'] = $category->getVar("cat_title"); $sitemap['parent'][$i]['url'] = "index.php?cat=".$cat_id;} if(count($forums)>0) foreach ($forums as $id=>$forum){$cid=$forum['cid']; $sitemap['parent'][$cid]['child'][$id] = $forum; $sitemap['parent'][$cid]['child'][$id]['image'] = 2; if(!empty($forum['fchild'])) foreach($forum['fchild'] as $_id=>$_forum){$sitemap['parent'][$cid]['child'][$_id] = $_forum; unset($_forum); $sitemap['parent'][$cid]['child'][$_id]['image'] = 3;} unset($forum);} /* In case not enable subcategory, do the following; Sorry, I have not tested with this mode yet. If any bugs, feel free to fix.*/ }else{if(count($forums)>0) foreach ($forums as $id=>$forum){$sitemap['parent'][$id] = $forum; if(!empty($forum['fchild'])) foreach($forum['fchild'] as $_id=>$_forum){$sitemap['parent'][$id]['child'][$_id] = $_forum; $sitemap['parent'][$cid]['child'][$id]['image'] = 2; unset($_forum);} unset($forum);}} return $sitemap;} /** My part ends, D.J. :=)*/ $db =& Database::getInstance(); $myts =& MyTextSanitizer::getInstance(); if($sitemap_configs["show_subcategoris"]){$sql = 'SELECT DISTINCT c.* FROM '.$db->prefix('bb_categories').' c, '.$db->prefix("bb_forums").' f WHERE f.cat_id=c.cat_id GROUP BY c.cat_id, c.cat_title, c.cat_order ORDER BY c.cat_order'; $result = $db->query($sql); $categories = array(); while ($cat_row = $db->fetchArray($result)){$i = $cat_row["cat_id"]; $sitemap['parent'][$i]['id'] = $cat_row["cat_id"]; $sitemap['parent'][$i]['title'] = $myts->makeTboxData4Show($cat_row["cat_title"]); $sitemap['parent'][$i]['url'] = "index.php?cat=".$cat_row["cat_id"]; $categories[] = $cat_row["cat_id"];}} $sql = "SELECT f.* FROM ".$db->prefix("bb_forums")." f LEFT JOIN ".$db->prefix("bb_categories")." c ON f.cat_id=c.cat_id ORDER BY f.forum_id"; $result = $db->query($sql); $i=0; while($forum_row = $db->fetchArray($result)) {if($sitemap_configs["show_subcategoris"]){$j = $forum_row["cat_id"]; $sitemap['parent'][$j]['child'][$i]['id'] = $forum_row["forum_id"]; $sitemap['parent'][$j]['child'][$i]['title'] = $myts->makeTboxData4Show($forum_row["forum_name"]); $sitemap['parent'][$j]['child'][$i]['image'] = 2; $sitemap['parent'][$j]['child'][$i]['url'] = "viewforum.php?forum=".$forum_row['forum_id'];} else{$sitemap['parent'][$i]['id'] = $forum_row["forum_id"]; $sitemap['parent'][$i]['title'] = $myts->makeTboxData4Show($forum_row["forum_name"]); $sitemap['parent'][$i]['url'] = "viewforum.php?forum=".$forum_row['forum_id'];} $i++;} //print_r($categories); return $sitemap;} ?> [/code] [code] http://localhost/finalize/modules/newbb/ ? ? http://localhost/finalize/modules/newbb/index.php?cat=1 ? ? http://localhost/finalize/modules/newbb/viewforum.php?forum=1 ? http://localhost/finalize/modules/newbb/ ? ? http://localhost/finalize/modules/newbb/viewforum.php?forum=2 ? ? http://localhost/finalize/modules/newbb/viewforum.php?forum=3 ? ? http://localhost/finalize/modules/newbb/viewforum.php?forum=4 ? ? http://localhost/finalize/modules/newbb/viewforum.php?forum=5 ? ? http://localhost/finalize/modules/newbb/viewforum.php?forum=6 ? ? http://localhost/finalize/modules/newbb/viewforum.php?forum=7 ? http://localhost/finalize/modules/newbb/search.php ? ? http://localhost/finalize/modules/newbb/viewpost.php ? ? http://localhost/finalize/modules/newbb/viewpost.php?new=1 ? ? http://localhost/finalize/modules/newbb/viewall.php ? ? http://localhost/finalize/modules/newbb/viewall.php?type=digest ? ? http://localhost/finalize/modules/newbb/viewall.php?type=unreplied ? ? http://localhost/finalize/modules/newbb/viewall.php?type=unread ? ? http://localhost/finalize/modules/newbb/rss.php?c=0 [/code]:-?[/quote]" />

Re: Sitemap Newbb XML failure after adding sub pages?
by wizanda on 2008/6/14 13:14:03

Thxz, yet the sub links were added purposely for Google...

Thinking to make a simpler plug-in for newbb, as that’s a lot of code to do a simple task....
Something more like this:
<?php function b_sitemap_newbb(){$xoopsDB =& Database::getInstance(); $block = sitemap_get_categoires_map($xoopsDB->prefix("bb_forums"), "forum_id", "cat_id", "forum_name", "viewforum.php?forum=", "forum_order"); return $block;} ?>

As mydownloads, mylinks, etc, look something like that, not sure why we would want all that checking done in the first place.....
Still need to fix that, yet as long as all forums show and all sub links, I will be happy.
Re: Sitemap Newbb XML failure after adding sub pages?
by trabis on 2008/6/14 12:43:58

Well, probably you want to keep thoose sub pages(links) int sitemap but not in the xml so do this:

replace xml_google.php line 57
with
le="color: #000000"><?php $sitemap = sitemap_show(1);


at sitemap.php line 5
le="color: #000000"><?php function sitemap_show($skip = 0) { global $xoopsUser, $xoopsConfig, $sitemap_configs ; $plugin_dir = XOOPS_ROOT_PATH . "/modules/sitemap/plugins/";


at sitemap.php line 42
le="color: #000000"><?php if (count($sublinks) > 0 && !($skip == 1 && $modules[$i]->getVar('dirname') == 'newbb')) {
Re: Sitemap Newbb XML failure after adding sub pages?
by trabis on 2008/6/14 11:51:04

Sitemap seems to grab sublinks and then the plugin.

Yo can try this
Hack include/sitemap.php at line 42
le="color: #000000"><?php if (count($sublinks) > 0 && $modules[$i]->getVar('dirname') != 'newbb') { foreach($sublinks as $sublink){ $block['modules'][$i]['sublinks'][] = array('name' => $sublink['name'], 'url' => XOOPS_URL.'/modules/'.$modules[$i]->getVar('dirname').'/'.$sublink['url']); } }

It will skip the newbb sublinks.
Re: Sitemap Newbb XML failure after adding sub pages?
by wizanda on 2008/6/14 7:59:19

Below the templates....with numbers now added....
le="color: #000000"><?php /*subpages*/ $modversion['sub'][0]['name'] = _MI_SEARCH; $modversion['sub'][0]['url'] = "search.php"; $modversion['sub'][1]['name'] = _MI_ALLPOSTS; $modversion['sub'][1]['url'] = "viewpost.php"; $modversion['sub'][2]['name'] = _MI_VANP; $modversion['sub'][2]['url'] = "viewpost.php?new=1"; $modversion['sub'][3]['name'] = _MI_ALL; $modversion['sub'][3]['url'] = "viewall.php"; $modversion['sub'][4]['name'] = _MI_DIGEST; $modversion['sub'][4]['url'] = "viewall.php?type=digest"; $modversion['sub'][5]['name'] = _MI_UNREPLIED; $modversion['sub'][5]['url'] = "viewall.php?type=unreplied"; $modversion['sub'][6]['name'] = _MI_UNREAD; $modversion['sub'][6]['url'] = "viewall.php?type=unread"; $modversion['sub'][7]['name'] = _MI_RSS; $modversion['sub'][7]['url'] = "rss.php?c=0";
Re: Sitemap Newbb XML failure after adding sub pages?
by trabis on 2008/6/14 1:59:30

Could we see that xoops_version.php?

Who's Online

195 user(s) are online (151 user(s) are browsing Support Forums)


Members: 0


Guests: 195


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits