예제 #1
0
파일: fieldset.php 프로젝트: alencarmo/OCF
 function createForm()
 {
     global $gorumroll, $jQueryLib, $fieldset_typ;
     JavaScript::addInclude(GORUM_JS_DIR . $jQueryLib);
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.dimensions.js");
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/field.js");
     JavaScript::addInclude(JS_DIR . "/fieldset_form.js");
     $this->cid = $gorumroll->rollid;
     // A deleteAll es cloneToSubcats mezoket csak akkor tesszuk ki, ha van ertelmuk:
     getDbCount($subcatNum, array("SELECT COUNT(*) FROM @category WHERE up=#cid#", $this->cid));
     if (!$subcatNum || !$this->cid) {
         $fieldset_typ["attributes"]["cloneToSubcats"][] = "form invisible";
     }
     getDbCount($nonFixFieldNum, array("SELECT COUNT(*) FROM @customfield WHERE cid=#cid# AND columnIndex LIKE 'col_%'", $this->cid));
     if (!$nonFixFieldNum) {
         $fieldset_typ["attributes"]["deleteAll"][] = "form invisible";
     }
     parent::createForm();
 }
예제 #2
0
 function sortFieldForm($elementName = "")
 {
     global $jQueryLib, $gorumroll;
     JavaScript::addInclude(GORUM_JS_DIR . $jQueryLib);
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/form.js");
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.center.js");
     // to center the loading animation image
     JavaScript::addInclude(JS_DIR . "/sort_custom_fields.js");
     JavaScript::addInclude(JS_DIR . "/propagate.js");
     // Propagate into all other categories:
     $propagatePostfix = OverlayController::addPropagateOverlay($gorumroll->rollid, "_sorting");
     // Propagate into the subcategories only:
     if ($gorumroll->rollid) {
         getDbCount($count, array("SELECT COUNT(*) FROM @category WHERE up=#cid#", $gorumroll->rollid));
         if ($count) {
             $propagatePostfix .= " " . OverlayController::addPropagateOverlay($gorumroll->rollid, "_sorting", "_subcat");
         }
     }
     JavaScript::addOnload("\n        \$('#itemfield-sortfield_form .submitfooter').append(" . G::js($propagatePostfix) . ");\n    ");
     $this->showHtmlList($elementName);
 }
예제 #3
0
파일: object.php 프로젝트: alencarmo/OCF
 function getCount(&$count)
 {
     global $cookiePath, $noCookieCount;
     //a kuki_count nem list-enkent tarolodik, csak egy van!
     //ez lehet, hogy eleg, de neha gondot okozhat:
     //pl. ketfele lista parhuzamos lapozgatasakor ket kulon ablakban
     if (!$noCookieCount && isset($_COOKIE["kuki_count"]) && $_COOKIE["kuki_count"]) {
         $count = $_COOKIE["kuki_count"];
     } else {
         $select = $this->getListSelect(TRUE);
         // select only
         if ($select == "") {
             handleErr("No select from getSelect class:" . $this->get_table(), __FILE__, __LINE__);
         }
         if (is_array($select)) {
             $select[0] = ereg_replace("SELECT .* FROM", "SELECT COUNT(*) FROM", $select[0]);
         } else {
             $select = ereg_replace("SELECT .* FROM", "SELECT COUNT(*) FROM", $select);
         }
         getDbCount($count, $select);
         if (!$noCookieCount) {
             setcookie("kuki_count", $count, 0, $cookiePath);
             $_COOKIE["kuki_count"] = $count;
         }
     }
     //echo "count:$count";
 }
예제 #4
0
파일: checkconf.php 프로젝트: alencarmo/OCF
 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;
 }
예제 #5
0
파일: category.php 프로젝트: alencarmo/OCF
 function recalculateAllItemNumsCore()
 {
     // megszamlaljuk az osszes aktiv kozvetlen itemet:
     getDbCount($count, array("SELECT COUNT(*) FROM @item WHERE cid=#this->id# AND status=1", $this->id));
     $this->directItemNum = $count;
     // eltaroljuk az uj directItemNum-ot:
     executeQuery("UPDATE @category SET directItemNum=#count# WHERE id=#this->id#", $count, $this->id);
     // betoltjuk a kozvetlen gyerekeket:
     $subcats = new AppCategory();
     $query = array("SELECT * FROM @category WHERE up=#this->id#", $this->id);
     loadObjectsSql($subcats, $query, $subcats);
     $this->itemNum = 0;
     if (count($subcats)) {
         foreach ($subcats as $cat) {
             // ha vannak gyerekei, rekurzivan kiszamoljuk a gyerekek itemNumjat:
             $cat->recalculateAllItemNumsCore();
             // a sajat itemNum a gyerekek itemNumjanak osszege:
             $this->itemNum += $cat->itemNum;
         }
     }
     // a teljes itemNumhoz a directItemNumot is hozza kell szamolni:
     $this->itemNum += $this->directItemNum;
     // elmentjuk az itemNumot:
     executeQuery("UPDATE @category SET itemNum=#this->itemNum# WHERE id=#this->id#", $this->itemNum, $this->id);
 }
예제 #6
0
파일: updatelib.php 프로젝트: alencarmo/OCF
function updateSettingsTable()
{
    global $noahVersion, $versionFooterText;
    executeQueryForUpdate("\n    ALTER TABLE @settings \n    CHANGE `settings_blockSize` `blockSize` INT(3) NOT NULL DEFAULT '100000',\n    CHANGE `settings_showExplanation` `showExplanation` TINYINT(4) NOT NULL DEFAULT '1',\n    CHANGE `settings_adminEmail` `adminEmail` VARCHAR(255) NOT NULL DEFAULT '',\n    CHANGE `settings_expiration` `expiration` INT(11) NOT NULL DEFAULT '30',\n    CHANGE `settings_expNoticeBefore` `expNoticeBefore` INT(11) NOT NULL DEFAULT '5',\n    CHANGE `settings_charLimit` `charLimit` INT(11) NOT NULL DEFAULT '10000',\n    CHANGE `settings_immediateAppear` `immediateAppear` INT(11) NOT NULL DEFAULT '1',\n    CHANGE `settings_maxPicSize` `maxPicSize` INT(11) NOT NULL DEFAULT '0',\n    CHANGE `settings_maxPicWidth` `maxPicWidth` INT(11) NOT NULL DEFAULT '0',\n    CHANGE `settings_maxPicHeight` `maxPicHeight` INT(11) NOT NULL DEFAULT '0',\n    CHANGE `settings_renewal` `renewal` INT(11) NOT NULL DEFAULT '5',\n    CHANGE `settings_allowModify` `allowModify` INT(11) NOT NULL DEFAULT '1',\n    DROP `settings_necessaryAuthLevel`,\n    DROP `settings_rangeBlockSize`,\n    DROP `settings_textAreaRows`,\n    DROP `settings_textAreaCols`,\n    DROP `settings_headTemplate`,\n    DROP `settings_upperTemplate`,\n    DROP `settings_lowerTemplate`,\n    DROP `settings_minPasswordLength`,\n    DROP `settings_htmlTitle`,\n    DROP `settings_htmlKeywords`,\n    DROP `settings_htmlDescription`,\n    DROP `settings_thumbnailWidth` ,\n    DROP `settings_thumbnailHeight` ,\n    DROP `settings_showChangePassword`,\n    DROP `settings_showLogout`,\n    DROP `settings_showLogin`,\n    DROP `settings_showRegister`,\n    DROP `settings_showMyProfile`,\n    DROP `settings_showMyAds`,\n    DROP `settings_showSubmitAd`,\n    DROP `settings_showRecentAds`,\n    DROP `settings_showMostPopularAds`,\n    DROP `settings_showSearch`,\n    DROP `settings_showHome`,\n    ADD `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ,\n    ADD subscriptionType int(11) NOT NULL default '2',\n    ADD `adminFromName` VARCHAR(255) NOT NULL DEFAULT '' AFTER adminEmail,\n    ADD `menuPoints` VARCHAR( 255 ) NOT NULL AFTER `maxPicHeight` ,\n    ADD `titlePrefix` VARCHAR( 255 ) NOT NULL AFTER `adminFromName`,\n    ADD `smtpServer` VARCHAR( 255 ) NOT NULL AFTER `adminFromName` ,\n    ADD `smtpUser` VARCHAR( 255 ) NOT NULL AFTER `smtpServer` ,\n    ADD `smtpPass` VARCHAR( 255 ) NOT NULL AFTER `smtpUser`,\n    ADD `fallBackNative` INT NOT NULL DEFAULT '0' AFTER `smtpPass`,\n    ADD `versionFooter` TEXT NOT NULL AFTER `showExplanation`,\n    ADD `helpLink` VARCHAR(255) NOT NULL AFTER menuPoints,\n    ADD `defaultTheme` VARCHAR( 255 ) NOT NULL AFTER `helpLink` ,\n    ADD `allowSelectTheme` INT NOT NULL DEFAULT '1' AFTER `defaultTheme` ,\n    ADD `allowedThemes` TEXT NOT NULL AFTER `allowSelectTheme`,\n    ADD `mainTitle` VARCHAR( 255 ) NOT NULL AFTER `titlePrefix` ,\n    ADD `mainDescription` TEXT NOT NULL AFTER `mainTitle` ,\n    ADD `mainKeywords` TEXT NOT NULL AFTER `mainDescription`,\n    ADD `showCreatedInLists` INT NOT NULL DEFAULT '0',\n    ADD `showCreatedInDetails` INT NOT NULL DEFAULT '1',\n    ADD `showExpInLists` INT NOT NULL DEFAULT '0',\n    ADD `showExpInDetails` INT NOT NULL DEFAULT '1',\n    ADD `dateFormat` VARCHAR( 100 ) NOT NULL DEFAULT 'Y-m-d',\n    ADD `enableFavorities` INT NOT NULL DEFAULT '1',\n    ADD `enableRememberPassword` INT NOT NULL DEFAULT '1',\n    ADD `enablePasswordReminder` INT NOT NULL DEFAULT '1',\n    ADD `maxMediaSize` INT(11) NOT NULL DEFAULT '50000' after mainKeywords,\n    ADD `updateCheckInterval` INT NOT NULL DEFAULT 7;", __FILE__, __LINE__);
    getDbCount($count, "SELECT * FROM @settings");
    $cmd = $count ? "UPDATE" : "INSERT INTO";
    executeQueryForUpdate("\n        {$cmd} @settings SET \n            id=1, \n            menuPoints='1,2,3,4,5,6,7,8,9,10,11,12', \n            defaultTheme='modern', \n            allowedThemes='classic,modern',\n            versionFooter='{$versionFooterText}'", __FILE__, __LINE__);
    $_S =& new AppSettings();
    if (strstr($_S->adminEmail, "*****@*****.**") || strstr($_S->adminEmail, "*****@*****.**")) {
        executeQueryForUpdate("UPDATE @settings SET adminEmail=''", __FILE__, __LINE__);
    }
}
예제 #7
0
파일: category.php 프로젝트: alencarmo/OCF
 function hasExpiration()
 {
     static $hasExpiration = FALSE;
     if ($hasExpiration !== FALSE) {
         return $hasExpiration;
     }
     getDbCount($hasExpiration, "SELECT COUNT(*) FROM @category WHERE expirationEnabled=1");
     return $hasExpiration;
 }
예제 #8
0
파일: itemfield.php 프로젝트: alencarmo/OCF
 function delete($includingRelatedCommonFields = TRUE)
 {
     if (load($this)) {
         return;
     }
     // ha mar nem letezik
     parent::delete();
     if ($this->isCommon && $includingRelatedCommonFields) {
         // ha egy common fieldet torlunk, az osszes azonos nevut torolni kell:
         executeQuery("DELETE FROM @customfield WHERE columnIndex=#ci# AND cid!=#cid# AND isCommon=1", $this->columnIndex, $this->cid);
         CacheManager::resetAllCache();
     }
     ItemSearch::deleteColumn($this);
     getDbCount($count, "SELECT COUNT(*) FROM @search WHERE uid=0");
     if ($count) {
         Roll::setInfoText("checkCustomLists");
         $this->nextAction =& new AppController("customlist/list");
     }
 }