/*----------------------------------------------------------------------*/
// include stuff
require_once($_SERVER[DOCUMENT_ROOT]."/../includes/topinclude.php");
require_once(INCPATH."classes/seocard.class.php");
require_once(INCPATH."classes/tagcloud.class.php");
require_once(INCPATH."classes/cover.class.php");
require_once(INCPATH."classes/covercat.class.php");
/*----------------------------------------------------------------------*/
// declare stuff
$covercatArr = array();
$coverArr = array();
/*----------------------------------------------------------------------*/
//get the script parameters out of the url
$nav = urldecode($_SERVER["REQUEST_URI"]);
$script = $_SERVER["SCRIPT_NAME"];
$nav = ereg_replace("^$script", "", $nav);
$nav = explode("&", $nav);
$vars = explode("/", $nav['0']);
$category = "";
$cover = "";
switch(sizeof($vars))
{
case 2:
$category = str_replace('_', '', $vars[1]);
$disp_category = str_replace('_', ' ', $vars[1]);
$searchQuery = str_replace(' ','+',$vars[1]);
break;
case 3:
$searchQuery = str_replace(' ','+',$vars[2]);
$category = str_replace('+', '', $vars[2]);
$disp_category = str_replace('+', ' ', $vars[2]);
break;
}
// get all available cover categories in order
if($category){
$query = "SELECT * from covercats where REPLACE(REPLACE(covercat_desc, ' ', ''), '\/', '') = '$category'";
$result = mysql_query($query)
or die ("Couldn't execute query." . mysql_error());
while ($row = mysql_fetch_array($result)){
$selected_category=$row['covercat_id'];
$selected_category_description=$row['covercat_description'];
}
}
$query = "SELECT * FROM covercats WHERE covercat_type = '1' AND covercat_status = '1' ORDER BY covercat_sort ASC LIMIT 100";
$result = mysql_query($query)
or die ("Couldn't execute query." . mysql_error());
while ($row = mysql_fetch_array($result)){
extract ($row);
$covercatArr[] = new covercat($covercat_id, $covercat_type, $covercat_desc, $covercat_sort, $covercat_status);
}
if(!$selected_category){
// $selected_category = $new_card_cat;
// $category='New Cards';
//srand((double)microtime()*1000000);
// $selected_category = rand(0,30);
// $category='Birthday';
$selected_category = 2;
}
if($selected_category){
$query = "SELECT cover_id, cover_name, covercat_desc, count( card_id ) AS mycount FROM covers, cards, covercats WHERE covers.cover_status=1 AND cards.card_cover = covers.cover_id AND covers.cover_cat = covercat_id AND covers.cover_cat = '$selected_category' GROUP BY cover_id ORDER BY mycount DESC";
$tagCloud=new tagcloud(0, $selected_category, 0);
$result = mysql_query($query)
or die ("Couldn't execute query." . mysql_error());
$i=0;
while ($row = mysql_fetch_array($result)){
extract ($row);
$coverArr[] = new seocard($cover_id, 1);
$i++;
}
$query = "SELECT * FROM scenes WHERE scene_cat = '$selected_category'";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
extract($row);
$customCoverArr[] = array($scene_guid,$scene_name);
}
}
else{
$query = "SELECT cover_id, cover_name, covercat_desc, count( card_id ) AS mycount FROM covers, cards, covercats WHERE covers.cover_status=1 AND cards.card_cover = covers.cover_id AND covers.cover_cat = covercat_id GROUP BY cover_id ORDER BY mycount DESC LIMIT 5";
$tagCloud=new tagcloud(0, 2, 0);
}
$headertoggle="3.gif";
/*if($_GET['r']=='ba'){
$headertoggle="1.jpg";
}*/
// ---------------------------------------------------------------------------
// ---------------------- Yahoo suggest --------------------------------------
// ---------------------------------------------------------------------------
if($searchQuery){
$appid = "fPiJ.HHV34EOyrTb8BHV1qOvob6IWl3WpDejq5nDShjSlbtRoR.YGZu5hp4GaXG5";
$url = "http://search.yahooapis.com/WebSearchService/V1/relatedSuggestion?appid=";
$url .= $appid;
$url .= "&results=4&query=" . $searchQuery;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$html = curl_exec($ch);
curl_close($ch);
$xml = simplexml_load_string($html);
}
?>
=$disp_category;?> - Free Group Greeting Cards from GroupCard
include(INCPATH."header.php"); ?>
// list all available card categories
foreach($covercatArr as $value){
if($selected_category==$value->covercat_id){
$covstyle = "covcat selected";
}else{
$covstyle = "covcat";
}
if(($value->covercat_desc != 'Top Cards') && ($value->covercat_desc != 'New Cards'))
echo('- '.$value->covercat_desc.'
'."\n");
}
?>
Tags : =$tagCloud->cloud?>
Start a card from the whole group!
if($xml){?>
Results for
echo str_replace('+',' ',$disp_category)?>
}?>
Didn't find what you want?
Click here to make your own cover!
// list all available card covers
if($coverArr){
foreach($coverArr as $value){
echo '- ';
echo('
'.$value->mycover->cover_name.''."\n");
echo ' ';
}
if($customCoverArr){
foreach($customCoverArr as $value){
echo '- ';
echo('' .
'
');
echo ' ';
}
}
}
?>