Thứ Năm, 1 tháng 12, 2016

PHP prevent form resubmit - SOLVED

Detail: Form submit. Page reload -> form resubmit again. I did take 3 days to find on google and SOLVED. So thanks all.
Solution: catch session at Server

CODE:
Server PHP
if (isset($_POST['formid']) && isset($_SESSION['formid']) && $_POST["formid"] == $_SESSION["formid"])
{
$_SESSION["formid"] = '';
$isFirstSubmit = true;
}else{
$isFirstSubmit = false;
}
/*FormSession validate submit*/
$_SESSION["formid"] = md5(rand(0,10000000));

At Form Add 
<form>
<input type="hidden" name="formid" value="<?php echo htmlspecialchars($_SESSION["formid"]); ?>"/>
</form>

Thứ Năm, 28 tháng 7, 2016

Joomla Category Intro_items Order diffrent Items

Des: Joomla category 'ITEMs' ORDER BY different category 'Intro_Items'
The reason: components/com_content/view/category/view.html.php
/*$this->intro_items = ContentHelperQuery::orderDownColumns($this->intro_items, $this->columns);*/

Close above line

Thứ Sáu, 3 tháng 6, 2016

Rsform Constant Contact Config

Rsform ConstantContact Config:
#1. Setup plugin constantcontact: enable plugin
#2. Rsform config -> constantcontact: input Account Client, password + key
Account constant contact client:
User client password
Key: naphs3tma2gudkhwnem5f5kg



#3. Rsform > Form > Properties option: constant contact.

Thứ Bảy, 23 tháng 1, 2016

Joomla 3.4.8 redirect profile issue SOLVED

Description: Category article link -> login form -> login SUCCESS->  return URL.
Step edit:
#1. Update file components\com_users\views\login\tmpl\default_login.php
Code
<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('login_redirect_url', $this->form->getValue('return'))); ?>" />
Replace
<input type="hidden" name="return" value="<?php echo JRequest::getVar('return'); ?>" />

#2. Update file components\com_users\controllers\user.php
Remove code:
// Don't redirect to an external URL.
if (!JUri::isInternal($data['return']))
{
    $data['return'] = '';
}

Chủ Nhật, 27 tháng 12, 2015

RSFORM Mapping article Current date time

Detail: RSFORM mapping create new article submit. Mapping CreateDate is the same format database datetime.
#Step 1: Add 1 input-text name 'CreateDate' - class hidden (invisible)
#Step2: Add default value:
//<code>
return date('o-m-d H:i:s');
//</code>
This return value the same format database datetime save.

Time zone - example GTM+10
//<code>
$date = date("Y-m-d H:m:s", (time()-(60*60*10)));
return $date;
//</code>
#Step3: mapping add createdate field: {CreateDate:value}

RSFORM dropdown value | text

RSFORM Pro - joomla 3.x
Dropdow item add:
value|Text
Note: separate '|' char.

Example: dropdown require
0|TextA
1|TextB
...

Thứ Sáu, 11 tháng 12, 2015

CB login redirect go to homepage.

Joomla 3.x, Community Builder(CB)
Time: December 2015
Description: SEF turn on, CB redirect after login go home page.
1. Turn OFF SEF joomla : CB redirect SUCCESS.
2. Turn ON SEF joomla: CB redirect to homepage.

Reason: Confict - SEF joomla CB login redirect >< com_redirectonlogin redirect
Solution: admin>Extension>com_redirectonlogin config login redirect