Jump to content

creating a main navigation under "Documents"


Guest FirestormNet

Recommended Posts

Guest FirestormNet

Hi, I am a newbie for cubeCart and have found it fab to use so far but have come a cropper with trying to create a top level navigation for my site.

I have followed all the posts for creating a new box etc but I can't seem to get it working.

I need to have it available for editing within CubeCart for my client, but at the moment I have what I want working by using hard html/css code.

You can see the site I have designed so far at http://www.firestorm-net.com/wrights/shop/

It is the top navigation which I need to "re-create" within CubeCart.

I have copied and re-named all the siteDocs files to includes/boxes/navDocs.ini.php, styleTemplates/boxes/navDocs.tpl, admin/docs/navDocs.php and admin/languages/en/lang.inc.php

All I have done in each navDoc file is:

navDocs.ini.php

if (eregi(".inc.php",$HTTP_SERVER_VARS['PHP_SELF']) || eregi(".inc.php",$_SERVER['PHP_SELF'])) {

	echo "<html>\r\n<head>\r\n<title>Forbidden 403</title>\r\n</head>\r\n<body><h3>Forbidden 403</h3>\r\nThe document you are requesting is forbidden.\r\n</body>\r\n</html>";

	exit;

}



// query database

$results = $db->select("SELECT doc_id, doc_name FROM ".$glob['dbprefix']."CubeCart_docs ORDER BY doc_name ASC");



$resultsForeign = $db->select("SELECT doc_master_id as doc_id, doc_name FROM ".$glob['dbprefix']."CubeCart_docs_lang WHERE doc_lang = '".$lang_folder."'"); 



$box_content = new XTemplate ("skins/".$config['skinDir']."/styleTemplates/boxes/navDocs.tpl");



// build attributes

if($results == TRUE){



	// start loop

	for ($i=0; $i<count($results); $i++){

 	

		if($i<count($results)-1){

			$box_content->parse("site_docs.a.sep");

		}

		

		

		if(is_array($resultsForeign)){

			

			for ($k=0; $k<count($resultsForeign); $k++){

		

				if($resultsForeign[$k]['doc_id'] == $results[$i]['doc_id']){

				

					$results[$i]['doc_name'] = $resultsForeign[$k]['doc_name'];

				

				}

				

			}

		

		}

		

		$results[$i]['doc_name'] = validHTML($results[$i]['doc_name']);

		$box_content->assign("DATA",$results[$i]);

		$box_content->parse("site_docs.a");

	

	} // end loop 

}

$box_content->parse("nav_docs");

$box_content = $box_content->text("nav_docs");

?>




navDocs.tpl:




<!-- BEGIN: nav_docs -->



<div class="siteDocs">

<!-- BEGIN: a -->



<a href="index.php?act=viewDoc&amp;docId={DATA.doc_id}" class="txtSiteDocs">{DATA.doc_name}</a>



<!-- BEGIN: sep --><span class="txtSiteDocs">|</span><!-- END: sep -->



<!-- END: a -->



</div>



<!-- END: nav_docs -->

I would paste the navDocs.php but it is loads of code and I just changed anything refering to siteDocs to navDocs.

Any help would me MOST appreciated :(

Firestorm

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...