function Show() { global $startpage; global $Tpl; global $now; global $terms; if (!$this->Visible) { return; } $ShownRecords = 0; $featcount = 0; $this->ds->Parameters["urls_title"] = CCGetFromGet("s_title", ""); $this->ds->Parameters["urls_description"] = CCGetFromGet("s_description", ""); $this->ds->Parameters["urlShowFeatured"] = CCGetFromGet("ShowFeatured", ""); if (CCGetFromGet("CatID", "") || $terms["CatID"]) { $catdb1 = new clsDBNetConnect(); $catdb1->connect(); $newSQL1 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . CCGetFromGet("CatID", "") . "'"; $incat = "'" . CCGetFromGet("CatID", "") . "'"; if ($terms["CatID"]) { $newSQL1 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $terms["CatID"] . "'"; $incat = "'" . $terms["CatID"] . "'"; } $catdb1->query($newSQL1); while ($catdb1->next_record()) { $incat .= " OR category='" . $catdb1->f(0) . "'"; $catdb2 = new clsDBNetConnect(); $catdb2->connect(); $newSQL2 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb1->f(0) . "'"; $catdb2->query($newSQL2); while ($catdb2->next_record()) { $incat .= " OR category='" . $catdb2->f(0) . "'"; $catdb3 = new clsDBNetConnect(); $catdb3->connect(); $newSQL3 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb2->f(0) . "'"; $catdb3->query($newSQL3); while ($catdb3->next_record()) { $incat .= " OR category='" . $catdb3->f(0) . "'"; $catdb4 = new clsDBNetConnect(); $catdb4->connect(); $newSQL4 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb3->f(0) . "'"; $catdb4->query($newSQL4); while ($catdb4->next_record()) { $incat .= " OR category='" . $catdb4->f(0) . "'"; $catdb5 = new clsDBNetConnect(); $catdb5->connect(); $newSQL5 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb4->f(0) . "'"; $catdb5->query($newSQL5); while ($catdb5->next_record()) { $incat .= " OR category='" . $catdb5->f(0) . "'"; } } } } } } //print $incat; $this->ds->Parameters["urlCatID"] = $incat; //CCGetFromGet("CatID", ""); $this->ds->Parameters["urls_ItemNum"] = CCGetFromGet("s_ItemNum", ""); if ($_GET["s_user_id"]) { $userfind = $_GET["s_user_id"]; $findDB = new clsDBNetConnect(); $GetUser = CCDlookUP("user_id", "users", "user_login='******'", $findDB); if ($GetUser == NULL) { $GetUser = 1000000000000.0; } } if (CCGetFromGet("User_ID", "")) { $GetUser = CCGetFromGet("User_ID", ""); } $this->ds->Parameters["urls_user_id"] = $GetUser; $this->ds->Parameters["urls_asking_min"] = CCGetFromGet("s_asking_min", ""); $this->ds->Parameters["urls_asking_max"] = CCGetFromGet("s_asking_max", ""); $this->ds->Parameters["urls_make_offer"] = CCGetFromGet("s_make_offer", ""); $this->ds->Parameters["urls_quantity"] = CCGetFromGet("s_quantity", ""); $this->ds->Parameters["urls_city_town"] = CCGetFromGet("s_city_town", ""); $this->ds->Parameters["urls_state_province"] = CCGetFromGet("s_state_province", ""); $this->ds->Parameters["urls_category"] = CCGetFromGet("s_category", ""); //$this->ds->Parameters["urlCatID"] = CCGetFromGet("CatID", ""); $this->ds->Prepare(); $this->ds->Open(); $GridBlock = "Grid " . $this->ComponentName; $Tpl->block_path = $GridBlock; $uncount = 0; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); $is_next_record = $this->ds->next_record(); if ($is_next_record && $ShownRecords < $this->PageSize) { do { $this->ds->SetValues(); $Tpl->block_path = $GridBlock . "/Row"; $this->image_one->SetValue(""); if ($this->ds->cat_featured->GetValue() == 1 && $featcount == 0) { $Tpl->SetVar("beginFeat", "<tr><td class=\"feat\" height=\"27\" colspan=\"6\"> Featured Items</td></tr>"); $featcount++; } if ($this->ds->cat_featured->GetValue() < 1 && $featcount == 1) { $this->image_one->SetValue("<tr class=\"wtbk\"><td colspan=\"6\"> </td><tr><td class=\"feat\" height=\"27\" colspan=\"6\"> End of Featured Items</td></tr>"); $featuredcounter++; $featcount++; } if ($this->ds->cat_featured->GetValue() == 1) { $uncount++; } if ($this->ds->bold->GetValue() == 1) { $this->bold2->SetValue("</b>"); $this->bold->SetValue("<b>"); } else { $this->bold2->SetValue(""); $this->bold->SetValue(""); } if ($this->ds->background->GetValue() == 1) { $this->background->SetValue("bgcolor=\"#FFFFC0\""); } else { $this->background->SetValue("class=\"wtbk\""); } if ($this->ds->image_preview->GetValue() == 1 && $this->ds->image_one->GetValue() != "") { if ($now["has_gd"]) { $this->image_preview->SetValue("<table bgcolor=\"#000000\" border=\"0\" width=\"78\" height=\"75\" cellspacing=\"1\" cellpadding=\"0\"><tr><td width=\"75\" height=\"75\" valign=\"middle\" align=\"center\" bgcolor=\"#FFFFFF\"><a href=\"ViewItem.php?ItemNum=" . $this->ds->ItemNum->GetValue() . "\" border=0><img src=\"imageresizer.php?heightsize=75&widthsize=75&filename=" . $this->ds->image_one->GetValue() . "\" border=0 /></a></td></tr></table>"); } else { $this->image_preview->SetValue("<table bgcolor=\"#000000\" border=\"0\" width=\"78\" height=\"75\" cellspacing=\"1\" cellpadding=\"0\"><tr><td width=\"75\" height=\"75\" valign=\"middle\" align=\"center\" bgcolor=\"#FFFFFF\"><a href=\"ViewItem.php?ItemNum=" . $this->ds->ItemNum->GetValue() . "\" border=0>" . thumbnail($this->ds->image_one->GetValue(), 75, 75, 0, 0) . "</a></td></tr></table>"); } } elseif ($this->ds->image_one->GetValue() != "") { $this->image_preview->SetValue("<img src=\"images/apic.gif\">"); } else { $this->image_preview->SetValue(""); } $this->ItemNum->SetValue($this->ds->ItemNum->GetValue()); $this->title->SetValue($this->ds->title->GetValue()); if ($this->ds->make_offer->GetValue() == 1) { $this->make_offer->SetValue(" <font color=#ff0000>(Make Offer)</font>"); } else { $this->make_offer->SetValue(""); } if ($this->ds->city_town->GetValue() != "") { $this->city_town->SetValue($this->ds->city_town->GetValue() . ", "); } else { $this->city_town->SetValue($this->ds->city_town->GetValue()); } $this->state_province->SetValue($this->ds->state_province->GetValue()); $this->asking_price->SetValue($this->ds->asking_price->GetValue()); $theday = getdate($this->ds->started->GetValue()); $lastofyear = substr($theday["year"], -2); $enddate = $theday["mon"] . "/" . $theday["mday"] . "/" . $lastofyear; $this->started->SetValue($enddate); unset($newdate); unset($theday); unset($lastofyear); unset($enddate); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow"); $this->bold->Show(); $this->bold2->Show(); $this->background->Show(); $this->image_preview->Show(); $this->image_one->Show(); $this->ItemNum->Show(); $this->title->Show(); $this->make_offer->Show(); $this->city_town->Show(); $this->state_province->Show(); $this->asking_price->Show(); $this->started->Show(); $Tpl->block_path = $GridBlock; $Tpl->parse("Row", true); $ShownRecords++; $is_next_record = $this->ds->next_record(); } while ($is_next_record && $ShownRecords < $this->PageSize); } else { $Tpl->SetVar("CloseFeat", "<tr class=\"wtbk\"><td class=\"feat\" colspan=\"6\">End of Featured Items</td></tr>"); $Tpl->parse("NoRecords", false); } $this->Navigator->TotalPages = $this->ds->PageCount(); $this->gallerylink->Show(); $this->Sorter_title->Show(); $this->Sorter_started->Show(); $this->Sorter_asking_price->Show(); $this->Sorter_location->Show(); $this->Navigator->Show(); if ($uncount == 1) { $Tpl->SetVar("CloseFeat2", "<tr class=\"wtbk\"><td colspan=\"6\"> </td></tr><tr><td class=\"feat\" colspan=\"6\">End of Featured Items</td></tr>"); } $Tpl->parse("", false); $Tpl->block_path = ""; //Print stopwatch($startpage); }
function Show() { global $Tpl; global $now; if (!$this->Visible) { return; } $ShownRecords = 0; $this->ds->Parameters["urls_title"] = CCGetFromGet("s_title", ""); $this->ds->Parameters["urls_description"] = CCGetFromGet("s_description", ""); $this->ds->Parameters["urlShowFeatured"] = CCGetFromGet("ShowFeatured", ""); if (CCGetFromGet("CatID", "")) { $catdb1 = new clsDBNetConnect(); $catdb1->connect(); $newSQL1 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . CCGetFromGet("CatID", "") . "'"; $incat = "'" . CCGetFromGet("CatID", "") . "'"; if ($terms["CatID"]) { $newSQL1 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $terms["CatID"] . "'"; $incat = "'" . $terms["CatID"] . "'"; } $catdb1->query($newSQL1); while ($catdb1->next_record()) { $incat .= " OR category='" . $catdb1->f(0) . "'"; $catdb2 = new clsDBNetConnect(); $catdb2->connect(); $newSQL2 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb1->f(0) . "'"; $catdb2->query($newSQL2); while ($catdb2->next_record()) { $incat .= " OR category='" . $catdb2->f(0) . "'"; $catdb3 = new clsDBNetConnect(); $catdb3->connect(); $newSQL3 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb2->f(0) . "'"; $catdb3->query($newSQL3); while ($catdb3->next_record()) { $incat .= " OR category='" . $catdb3->f(0) . "'"; $catdb4 = new clsDBNetConnect(); $catdb4->connect(); $newSQL4 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb3->f(0) . "'"; $catdb4->query($newSQL4); while ($catdb4->next_record()) { $incat .= " OR category='" . $catdb4->f(0) . "'"; $catdb5 = new clsDBNetConnect(); $catdb5->connect(); $newSQL5 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb4->f(0) . "'"; $catdb5->query($newSQL5); while ($catdb5->next_record()) { $incat .= " OR category='" . $catdb5->f(0) . "'"; } } } } } } //print $incat; $this->ds->Parameters["urlCatID"] = $incat; //CCGetFromGet("CatID", ""); $this->ds->Parameters["urls_ItemNum"] = CCGetFromGet("s_ItemNum", ""); if (CCGetFromGet("s_user_id", "")) { $userfind = CCGetFromGet("s_user_id", ""); $findDB = new clsDBNetConnect(); $GetUser = CCDlookUP("user_id", "users", "user_login='******'", $findDB); if ($GetUser == NULL) { $GetUser = 1000000000000.0; } } if (CCGetFromGet("User_ID", "")) { $GetUser = CCGetFromGet("User_ID", ""); } $this->ds->Parameters["urls_user_id"] = $GetUser; $this->ds->Parameters["urls_asking_min"] = CCGetFromGet("s_asking_min", ""); $this->ds->Parameters["urls_asking_max"] = CCGetFromGet("s_asking_max", ""); $this->ds->Parameters["urls_make_offer"] = CCGetFromGet("s_make_offer", ""); $this->ds->Parameters["urls_quantity"] = CCGetFromGet("s_quantity", ""); $this->ds->Parameters["urls_city_town"] = CCGetFromGet("s_city_town", ""); $this->ds->Parameters["urls_state_province"] = CCGetFromGet("s_state_province", ""); $this->ds->Parameters["urls_category"] = CCGetFromGet("s_category", ""); //$this->ds->Parameters["urlCatID"] = CCGetFromGet("CatID", ""); $this->ds->Prepare(); $this->ds->Open(); $GridBlock = "Grid " . $this->ComponentName; $Tpl->block_path = $GridBlock; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); $is_next_record = $this->ds->next_record(); $CounterItems = 1; if ($is_next_record && $ShownRecords < $this->PageSize) { do { $this->ds->SetValues(); $Tpl->block_path = $GridBlock . "/Row"; $Tpl->SetVar("breaker", ""); if ($CounterItems % 4 == 0) { $Tpl->SetVar("breaker", "</tr><tr>"); } $CounterItems++; if ($this->ds->image_one->GetValue() != "") { if ($now["has_gd"]) { $this->image_one->SetValue("<table bgcolor=\"#000000\" border=\"0\"><tr><td width=\"75\" height=\"75\" valign=\"middle\" align=\"center\" bgcolor=\"#FFFFFF\"><a href=\"ViewItem.php?ItemNum=" . $this->ds->ItemNum->GetValue() . "\"><img src=\"imageresizer.php?heightsize=75&widthsize=75&filename=" . $this->ds->image_one->GetValue() . "\" border=0 /></a></td></tr></table>"); } else { $this->image_one->SetValue("<table bgcolor=\"#000000\" border=\"0\"><tr><td width=\"75\" height=\"75\" valign=\"middle\" align=\"center\" bgcolor=\"#FFFFFF\"><a href=\"ViewItem.php?ItemNum=" . $this->ds->ItemNum->GetValue() . "\">" . thumbnail($this->ds->image_one->GetValue(), 75, 75, 0, 0) . "</a></td></tr></table>"); } } $this->ItemNum->SetValue($this->ds->ItemNum->GetValue()); $this->title->SetValue($this->ds->title->GetValue()); if ($this->ds->make_offer->GetValue() == 1) { $this->make_offer->SetValue("<BR><font color=#ff0000>(Make Offer)</font>"); } else { $this->make_offer->SetValue(""); } $this->asking_price->SetValue($this->ds->asking_price->GetValue()); $theday = getdate($this->ds->started->GetValue()); $lastofyear = substr($theday["year"], -2); $enddate = $theday["mon"] . "/" . $theday["mday"] . "/" . $lastofyear; $this->started->SetValue($enddate); if ($this->ds->city_town->GetValue() != "") { $this->city_town->SetValue($this->ds->city_town->GetValue() . ", "); } else { $this->city_town->SetValue($this->ds->city_town->GetValue()); } $this->state_province->SetValue($this->ds->state_province->GetValue()); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow"); $this->image_one->Show(); $this->ItemNum->Show(); $this->title->Show(); $this->make_offer->Show(); $this->asking_price->Show(); $this->started->Show(); $this->city_town->Show(); $this->state_province->Show(); $Tpl->block_path = $GridBlock; $Tpl->parse("Row", true); $ShownRecords++; $is_next_record = $this->ds->next_record(); } while ($is_next_record && $ShownRecords < $this->PageSize); } else { $Tpl->parse("NoRecords", false); } $this->Navigator->TotalPages = $this->ds->PageCount(); $this->itemslink->Show(); $this->Navigator->Show(); $Tpl->parse("", false); $Tpl->block_path = ""; }