• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Need some help with meta data for php pages

Sitebee

UFO Hunter
NLC
Could do with some help or advice here please.

Im working on a website that has meta data pulled from Curl feeds, whoever made it never left any instructions on how to manage the feeds, there`s 1000`s of lines of text in the feeds. I even copied a few of the page titles to find where it was in the feeds but never found any matches.

All the page`s are pulling in the header.php and the header is pulling in the Curl feeds.

Code:
<title><?php

	if(isset($_GET['prod'])){
	
		if(isset($catTree[0]['cat_name'])&&isset($catTree[1]['cat_name'])){
					
			$vars = array (	"api_key" 			=> "",
									"subject" 			=> $_SERVER["REQUEST_URI"].$catTree[0]['cat_name'].$catTree[1]['cat_name'].$_GET['prod'],
									"file"					=> "",
									"type"				=> $catTree[0]['cat_name'],
									"label"				=> "",
									"num"				=> 3,
									"find_replace"	=> array("xx" => $product['prod_name'], "yy" =>$catTree[1]['cat_name'], "zz" => $catTree[0]['cat_name']),
									"genTitle"			=> ''
									);
			        
			$encoded_vars = http_build_query($vars);
			
			$ch = curl_init();
			curl_setopt($ch, CURLOPT_URL,"");
			curl_setopt($ch, CURLOPT_POST, 1);
			curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded_vars);
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
			
			$content = curl_exec($ch);
				
			curl_close($ch);
			
			echo $content;
		
		}
	
	}
	
	else {

?>


<?php if(isset($RSseo[$_GET['cat']])){echo $RSseo[$_GET['cat']]['title'];} else {?><?php echo $caseItem["title"]; ?><?php echo $newsItem["title"]; ?> <?=((isset($page) && isset($page["meta_title"]) && strlen($page["meta_title"]) > 0) ? $page["meta_title"] : $meta["meta_title"] ); }}?>
</title>

<meta name="description" content="<?php 

	#print_r($catTree);
	
		if(isset($catTree[0]['cat_name'])&&isset($catTree[1]['cat_name'])&&isset($_GET['prod'])){
		
			$vars = array (	"api_key" 		=> "",
								"subject" 			=> $_SERVER["REQUEST_URI"].$catTree[0]['cat_name'].$catTree[1]['cat_name'].$_GET['prod'],
								"file"					=> ($catTree[0]['cat_name']=='Used Furniture'?"usedMetaIndiv":"newMetaIndiv"),
								"type"				=> "meta",
								"label"				=> "",
								"num"				=> 3,
								"find_replace"	=> array("xx" => $product['prod_name'], "yy" =>$catTree[1]['cat_name'], "zz" => trim($catTree[0]['cat_name'])),
								"genMetaDescription"			=> ''
								);
		        
		$encoded_vars = http_build_query($vars);
		
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL,"");
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded_vars);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		
		$content = curl_exec($ch);
			
		curl_close($ch);
		
		echo $content;

		
		}
	
	
	else {

if(isset($RSseo[$_GET['cat']])){echo $RSseo[$_GET['cat']]['metaDesc'];} 

else { echo $caseItem["title"]; ?><?php echo $newsItem["title"]; ?> <?=((isset($page) && isset($page["meta_description"]) && strlen($page["meta_description"]) > 0) ? $page["meta_description"] : $meta["meta_description"] ); }

}

?>" />


<meta name="keywords" content="<?php if(isset($RSseo[$_GET['cat']])){echo $RSseo[$_GET['cat']]['metaKeyw'];} else {((isset($page) && isset($page["meta_keywords"]) && strlen($page["meta_keywords"]) > 0) ? $page["meta_keywords"] : $meta["meta_keywords"] ); }?>" />



Rather than trying to work out all the code and piece together what goes where, I want to use another method. I remember working on another website that had a simpler method but I don`t remember how it was coded.

I need a method where I can pull in a file that I can use page id`s and specify the meta data for each page and I can re-write all the meta data as it`s not very good and most pages are keyword stuffed, the simple the better and preferably not database driven.

Any suggestions?
 
Last edited:
Back
Top