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

Thứ Ba, 3 tháng 11, 2015

Joomla 3.4.5 sef remove article id SOLVED

Description: remove article id at sef url: id-alias.
File edit: components\com_content\router.php
#Step 1: 2 line replace all
$advanced = $params->get('sef_advanced_link', 0);
to
$advanced = $params->get('sef_advanced_link', 1);

#Step2:
if (strpos($segments[0], ':') === false)
{
$vars['view'] = 'article';
$vars['id'] = (int) $segments[0];

return $vars;

}
to
/*if (strpos($segments[0], ':') === false)
{
$vars['view'] = 'article';
$vars['id'] = (int) $segments[0];

return $vars;

}
*/

Thứ Năm, 22 tháng 10, 2015

JQUERY get image full path

Des: get full path image http,domain,subfolder,filename

JQUERY:

var imagefullpath=$('img')[0].src;
alert(imagefullpath);
result: http//domain.com/subfolder/image-name.jpg
-
var imgagepath=$('img').attr('src');
alert(imagepath);
result: subfolder/image-name.jpg

Thứ Hai, 28 tháng 9, 2015

Fixed, absolute position auto center SOLVED

.divfixcenter{
position:fixed;
top:50%;
left:50%;
width: 500px;
transform: translate(-50%, -50%);
-webkit-transform:translate(-50%, -50%);/*safari*/
}

Thứ Ba, 8 tháng 9, 2015

Filezilla FTP Use Proxy solved

Des: ip prevent connect to host. It's hard to find way, i did take 2 day read on internet and try.
Solution: use proxy have other way connect work.

#1. Find proxy server work:
http://incloak.com/proxy-list/
Find SOCKS5 type
Choose the best speed
#2. Cofig Filezilla:
Edit menu-> Setting->Generic Proxy input host + port

Image guide:


Note: Can try other proxy.
State: SOLVED.

Chủ Nhật, 23 tháng 8, 2015

.htaccess directory index

Description: Use .htacccess file index priority index.php, index.html, index.asp...
Solution: .htaccess file
Add code:
DirectoryIndex index.php index.html

Thứ Sáu, 3 tháng 7, 2015

Font fontAwesome - Icons the easiest way

Description: mutli icons use by font. So easy change color + size by CSS.

Thinking: So love this font. Save much time css hover active
Example icons:  home, phone, fax, arrow, users, cubes, tree, leaf
Insert 1 line:  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
Using exmple:
    <i class="fa fla-home"></i>
    <a class="fa fla-phone"></a>   
Icons list:
http://fortawesome.github.io/Font-Awesome/icons/




Guide: http://fortawesome.github.io/Font-Awesome/get-started/

Thứ Ba, 30 tháng 6, 2015

Joomla 3.2.0 passwords issue - SOLVED

Joomla 3.2.0 is a result of terrible coding and total irresponsibility: users registration and password reset are broken and passwords are not recognized. Please note that Joomla 3.2.1+ doesn't have these issues.
We suffered from this a couple of days and finally propose a solution, though you can just install Joomla_3.1.6-Stable-Update_Package.zip and downgrade.
Edit /libraries/joomla/user/helper.php:
1. Change
$encrypted = ($salt) ? md5($plaintext . $salt) : md5($plaintext);
to
$encrypted = ($salt) ? md5($plaintext . $salt) . ':' . $salt : md5($plaintext);
Edit /libraries/joomla/user/user.php:
2. Change
$array['password'] = $crypt . ':' . $salt;
to
$array['password'] = $crypt;
Edit /components/com_users/models/reset.php:
3. Change
$password = $crypted . ':' . $salt;
to
$password = $crypted;
4. Change
if (!($crypt == $testcrypt))
to
if (!($user->activation == $testcrypt))
5. Change
$testcrypt = JUserHelper::getCryptedPassword($data['token'], $salt);
to
$testcrypt = JUserHelper::getCryptedPassword($data['token'], $salt, 'md5-hex');
Edit /plugins/authentication/joomla/joomla.php:
6. Change
if ($crypt == $testcrypt)
to
if ($result->password == $testcrypt)

Reset your password if it still doesn't work after these changes.
Reference link http://alterbrains.com/blog/joomla-3-2-passwords-issue-problem-solution

Chủ Nhật, 28 tháng 6, 2015

Widgetkit 2 Map multi Icon markers

Description: Each map use own icon marker. Must edit code

Solution 3 steps:
#1. New field 'icon' at administrator>map. lable icon, name icon, type media
#2. Edit widget.php:
File: administrator\components\com_widgetkit\plugins\widgets\map\views\widget.php
Line : 18
'icon' =>$item['icon']

#3. Edit map.js:
file: administrator\components\com_widgetkit\plugins\widgets\map\assets\maps.js
file and replace code.
google.maps.Marker({position:new google.maps.LatLng(t.lat,t.lng),map:i,title:t.title,icon: t.icon});

Images instruction:



Thứ Hai, 22 tháng 6, 2015

admin com_installer&view=manage blank page

Description: /administrator/index.php?option=com_installer&view=manage blank page. Not view error. Joomla 3.4.1
File edit: administrator\components\com_installer\models\extension.php
Line 69: /*$this->translate($result);*/

Thứ Bảy, 20 tháng 6, 2015

com_weblinks joomla 3.4.1 get from jomla 3.1 - 3.3

Description: joomla 3.4.1 com_weblinks not found. Search internet not better.
Solution: get com_weblinsk from older joomla version (joomla 3.2-joomla 3.3)
#1. Copy administrator\components\com_weblinks
#2. Copy components\com_weblinks
#3. database table #_extensions export & import 1 record 'com_widgekit'
#4. database table #_menu export & import 3 record:
'com_weblinks'
'com_weblinks_links'
'com_weblinks_categories
'


Good luck

Thứ Năm, 18 tháng 6, 2015

Check MySQL connect_timeout

Description: Check mysql connec time out. Increate more time. Default is 10 miliseconds
run query:

SHOW VARIABLES LIKE 'connect_timeout';
SET GLOBAL connect_timeout=1000;


Notes: Set global not work: contact to host edit setting connect time.

Thứ Sáu, 22 tháng 5, 2015

Joomla 3.x add list limit backend


Description: add more limit selector backend
Example: 20,50,100,5000,10000,ALL
Location file: libraries\cms\pagination - Line: 554
Add code example:
$limits[] = JHtml::_('select.option', '5000', JText::_('5000'));
$limits[] = JHtml::_('select.option', '10000', JText::_('10000'));


Thứ Ba, 5 tháng 5, 2015

Share plugin Guru Search

Version: Joomla 3.x, Guru 3.x
Infomation: this version Guru not provide search plugin -> i write new plugin
Compatible: joomla search, module search, smart search
Source clean
Instruction: Download file plugin_search_guru.zip, setup, turn on plugin
View:

Thứ Tư, 22 tháng 4, 2015

Joomla 3.x mod_jo_responsive_grid_gallery edit load from 10 params

Description: JOOMLA 3.x  mod_jo_responsive_grid_gallery default load articles joomla . Current need add image,title, link whatever from 10 params.
Image result:

Instruction: this module not free. So just share 2 file edit only.
mod_jo_responsive_grid_gallery_articles.xml
mod_jo_responsive_grid_gallery_articles.php

Thứ Bảy, 18 tháng 4, 2015

Joomla3.x get PARAM url

Description: joomla3.x get param from url
Example:
http://domain.com/index.php?option=com_docman&view=document&layout=form&slug=&category_slug=&Itemid=102

Code:
$option = JRequest::getVar('option');   
echo $option;

Result: com_docman

Thứ Hai, 16 tháng 3, 2015

Div Float width auto: can padding/margin inner

Requirement:
Div1 float left, width auto.
Div2 width auto.
Div2 inner can padding,magrin.

Image :


Thứ Tư, 11 tháng 3, 2015

DNP News Module custom load K2 Source

Module Name: DNP New Modules
Folder Name: mod_dnp_news
Descritption: 
This version Not support K2 Source
Custome code for k2 Source
Result:
Solution:
This module not Free- so I have just share 4 files need edit.
-
Add select K2 category at admin
#1: mod_dnp_news-K2-Source\admin\elements\categoriesmultiple.php
https://drive.google.com/file/d/0B785Epf6q5XlRlA2elBMYmwyVGc/view?usp=sharing
-
Module .xml add field K2 param
#2: mod_dnp_news-K2-Source\mod_dnp_news.xml
https://drive.google.com/file/d/0B785Epf6q5XlTzY3YXYtUEVfWlE/view?usp=sharing
-
Edit helper load k2 items from database
#3: mod_dnp_news-K2-Source\helper.php
https://drive.google.com/file/d/0B785Epf6q5XlczRxWTFVWWdaTmM/view?usp=sharing
-
Edit view load k2 item
#4: mod_dnp_news-K2-Source\tmpl\swiper.php
https://drive.google.com/file/d/0B785Epf6q5Xlb1kzOHdYZ1I0WlU/view?usp=sharing

Thứ Hai, 2 tháng 3, 2015

Easy MP3 HTML5 Playlist

Include: css, html, script
<style>
#Audio_Container {
    width: 320px;
    position:relative;
}
.Audio_inner {
    background: none repeat scroll 0 0 #333;
    border-radius: 5px;
    display: inline-block;
    width:100%;
}
audio{   
    border-radius:5px;
    height:30px;
    width:250px;
}
#playlist{
    background:#333;
    display:none;
    margin: 1px 0;
    padding: 0;   
    position: absolute;
    width: 100%;
}
#playlist .active a {
    color:#5DB0E6;   
}
#playlist li a {
    color:#eeeedd;
    background:#333;
    padding:5px;
    display:block;
    text-decoration:none;
}
#playlist li{
    padding-left:15px;
}
.playlist_button{
    float:left;
    color:#FFF;
    cursor:pointer;   
    padding:5px 10px;   
}
.playlist_button:hover{
    color:#cecece;
}
</style>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

<!--HTML-->
<div id="Audio_Container">
    <div class="Audio_inner">
        <div class="playlist_button" href="#">Playlist</div>
        <audio id="audio" preload="auto" tabindex="0" controls="" type="audio/mpeg">   
            <source type="audio/mp3" src="http://www.archive.org/download/bolero_69/Bolero.mp3">Sorry, your browser does not support HTML5 audio.
        </audio>
    </div>   
    <ul id="playlist">
        <li class="active">
            <a href="http://www.archive.org/download/bolero_69/Bolero.mp3">Ravel Bolero</a>
        </li>
        <li>
            <a href="http://www.archive.org/download/MoonlightSonata_755/Beethoven-MoonlightSonata.mp3">Moonlight Sonata - Beethoven</a>
        </li>
        <li>
            <a href="http://www.archive.org/download/CanonInD_261/CanoninD.mp3">Canon in D Pachabel</a>
        </li>
    </ul>
</div>
<!--EndHTML-->


<!--SCRIPT_AUDIO-->
<script type="text/javascript">
var audio;
var playlist;
var tracks;
var current;

Audio_init();

function Audio_init() {
    current = 0;
    audio = $('audio');
    playlist = $('#playlist');
    tracks = playlist.find('li a');
    len = tracks.length - 1;
    audio[0].volume = .10;
    audio[0].play();
    playlist.find('a').click(function (e) {
        e.preventDefault();
        link = $(this);
        current = link.parent().index();
        run(link, audio[0]);
    });
    audio[0].addEventListener('ended', function (e) {
        current++;
        if (current == len) {
            current = 0;
            link = playlist.find('a')[0];
        } else {
            link = playlist.find('a')[current];
        }
        run($(link), audio[0]);
    });
    /*PlayListClick*/
    $('.playlist_button').click(function() {            
        /*Hidden*/       
        if ($(this).hasClass('active')){
            $(this).removeClass('active');
            $(playlist).slideUp();
        }
        /*View*/
        else{
            $(this).addClass('active');
            $(playlist).slideDown();
        }       
    });   
}

function run(link, player) {
    player.src = link.attr('href');
    par = link.parent();
    par.addClass('active').siblings().removeClass('active');
    audio[0].load();
    audio[0].play();
}
</script>
<!--END_SCRIPT_AUDIO-->


Link download https://drive.google.com/file/d/0B785Epf6q5XlTHA5bFNrMnc5azQ/view?usp=sharing

Thứ Tư, 11 tháng 2, 2015

Joomla3.x Overwrite new Layout mod_menu

1. Create file overwrite layout + sub files overwrite


2. In file filter.php edit line to specify new sub files
At file new.php : replace default_ to new_
Detail: this mean new layout use sub new_ files.
Edit line: 79-85
        case 'heading':
            require JModuleHelper::getLayoutPath('mod_menu', 'default_' . $item->type);
            break;

        default:
            require JModuleHelper::getLayoutPath('mod_menu', 'default_url');
            break;

Replace this:
        case 'heading':
            require JModuleHelper::getLayoutPath('mod_menu', 'new_' . $item->type);
            break;

        default:
            require JModuleHelper::getLayoutPath('mod_menu', 'new_url');
            break;

3. At Administrator>Modules Manager>Menu choose new layout

Thứ Sáu, 16 tháng 1, 2015

Recreate k2 thumnails items cache

Description:
K2 recreate all thumnails media/k2/item/cache 
Recreate all pictures thumnail with new options.
Default k2 not funtion rereate thumnail

Solution:
1) Copy this file as rebuild.php into "JPATH_ROOT/media/k2/items"
2) Check Variables, use a size of 0 for not processing this image size - Variable in file rebuild.php
3) run rebuild.php (it overwrites existing files without notice)
 
File download:
https://drive.google.com/file/d/0B785Epf6q5Xldks2eHlRX1Nla1U/view?usp=sharing

This guide get from: https://github.com/rdeutz/rebuildK2imageCache

CHECKED recreate thumnails >100 images in <5 minutes
Note: InCase so much images can have time execution -> download all images at localhost, run rebuild at local,  then upload to host.

Maximum execution time of 120 seconds XAMPP localhost

Description: Localhost XAMPP joomla Fatal error: Maximum execution time of 120 seconds exceeded
Solution: Localhost: xampp\php\php.ini
max_execution_time = 5000

Chủ Nhật, 11 tháng 1, 2015

Iframe auto height content inner

Iframe.Load inner height.

$('iframe').load(function () {
    $('iframe').height($('iframe').contents().height());
});