Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- switch ($requiredVar) {
- case "brand":
- $brandFieldsArray = $dbA->retrieveAllRecordsFromQuery("select * from tableFields where type='X' and visible=1");
- $result = $dbA->query("select bID from tableItems where iID = $x");
- if ($dbA->count($result) != null) {
- $thisrecord = $dbA->fetch($result);
- $bID = $thisrecord["bID"];
- } else {
- $bID = null;
- }
- $bQuery = $dbA->query("select * from tableB where bID=$bID");
- $theBrandArray = $dbA->retrieveAllRecordsFromQuery($bQuery);
- $bcCount = count($theBrandsArray);
- $brandContentArray = null;
- foreach ((array) $theBrandArray as $brandContent) {
- $allBrandFields = "";
- if (is_array($brandFieldsArray)) {
- $cc = count($brandFieldsArray);
- foreach ($brandFieldsArray as $brField) {
- $thisBrandField = $brField;
- switch ($thisBrandField["fieldtype"]) {
- case "TEXT":
- case "TEXTAREA":
- case "IMAGE":
- if ($thisBrandField["fieldtype"] == "IMAGE") {
- if ($brandContent["brandfield".$brField["fieldname"]] == "") {
- $thisBrandField["content"] = $brfield["defaultimage"];
- } else {
- $thisBrandField["content"] = $brandContent["brandfield".$brField["fieldname"]];
- }
- $thisField = generateImageVariables($brField["x"],$brField["y"]);
- $thisBrandField["style"] = $thisField["style"];
- $thisBrandField["stylefull"] = $thisField["stylefull"];
- } else {
- $brandContent["brandfield".$brField["fieldname"]] = findCorrectLanguage($brandContent,"brandfield".$brField["fieldname"]);
- if (retrieveOption("convertToBR") == 1 && retrieveOption("WYSIWYGEnabled") == 0) {
- $thisBrandField["content"] = str_replace("rn","<br/>",$brandContent["brandfield".$brField["fieldname"]]);
- } else {
- $thisBrandField["content"] = $brandContent["brandfield".$brField["fieldname"]];
- }
- }
- break;
- }
- $brandContent[$brField["fieldname"]] = @$thisBrandField;
- }
- if (is_array($allBrandFields)) {
- $brandContent["brandfields"] = $allBrandFields;
- } else {
- $brandContent["brandfields"] = null;
- }
- }
- $brandContentArray[] = $brandContent;
- }
- return ($type != "m") ? $brandContentArray[0] : $brandContentArray;
- }
- $tpl->addVariable("brand",$brandContentArray);
- break;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement