Jump to content

Search the Community

Showing results for tags 'array $_post'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hello, In the following function, I want to define default values for 'i18n'. I believe it is an array, it shows in another file defined as: public $i18n = array('title', 'description', 'terms', 'confirm_tokens', 'confirm_subject', 'payment_tokens', 'payment_subject', 'meta_title', 'meta_keywords', 'meta_description'); So I would need to set default values of i18n to 'text1', 'text 2', 'text 3', ... in the function below. Could you help? Thanks $this->checkLogin(); if ($this->isAdmin() || $this->isEditor() || $this->isOwner()) { if (isset($_POST['listing_create'])) { $data = array(); if (isset($_POST['expire'])) { $data['expire'] = pjUtil::formatDate($_POST['expire'], $this->option_arr['o_date_format']); } $data['last_extend'] = 'free'; if ($this->isOwner()) { $data['owner_id'] = $this->getUserId(); $data['status'] = 'E'; $data['is_featured'] = 'F'; $data['expire'] = date("Y-m-d", strtotime("-1 day")); } $data = array_merge($_POST, $data); $pjListingModel = pjListingModel::factory(); if (!$pjListingModel->validates($data)) { pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdminListings&action=pjActionCreate&err=1"); } if ($pjListingModel->where('t1.listing_refid', $data['listing_refid'])->findCount()->getData() > 0) { pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdminListings&action=pjActionCreate&err=1"); } //$data = pjSanitize::clean($data); $id = $pjListingModel->reset()->setAttributes($data)->insert()->getInsertId(); if ($id !== false && (int) $id > 0) { $err = 'AC03'; if (isset($_POST['i18n'])) { pjMultiLangModel::factory()->saveMultiLang($_POST['i18n'], $id, 'pjListing'); } $this->notify(2, NULL, array('property_id' => $id, 'listing_refid' => $data['listing_refid'])); } else { $err = 'AC04'; } if ($id !== false && (int) $id > 0) { pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdminListings&action=pjActionUpdate&id=" . $id); } else { pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdminListings&action=pjActionCreate&err=1"); } } if ($this->isOwner()) { $this->set('period_arr', pjPeriodModel::factory()->orderBy('t1.days ASC')->findAll()->getData()); } $type_arr = pjTypeModel::factory()->select('t1.*, t2.content AS name') ->join('pjMultiLang', "t2.model='pjType' AND t2.foreign_id=t1.id AND t2.field='name' AND t2.locale='".$this->getLocaleId()."'") ->where('t1.status', 'T')->orderBy('name ASC')->findAll()->getData(); $this->set('type_arr', pjSanitize::clean($type_arr)); $user_arr = pjUserModel::factory()->orderBy('t1.name ASC')->findAll()->getData(); $this->set('user_arr', pjSanitize::clean($user_arr)); $this->appendJs('chosen.jquery.js', PJ_THIRD_PARTY_PATH . 'harvest/chosen/'); $this->appendCss('chosen.css', PJ_THIRD_PARTY_PATH . 'harvest/chosen/'); $this->appendJs('jquery.tipsy.js', PJ_THIRD_PARTY_PATH . 'tipsy/'); $this->appendCss('jquery.tipsy.css', PJ_THIRD_PARTY_PATH . 'tipsy/'); $this->appendJs('jquery.validate.min.js', PJ_THIRD_PARTY_PATH . 'validate/'); $this->appendJs('pjAdminListings.js'); } else { $this->set('status', 2); }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.