Thứ Sáu, 27 tháng 8, 2021

Joomla 3.x uninstall language

Ghi nhận: settup thêm DE language. Sau đó uninstall admin>manage 1 language ko được
Giải pháp: chọn language package rồi uninstall
Nguyên nhân: là theo package cả admin và site

Wordpress - remove title by Yoast SEO - SOLVED

Vấn đề của mình: Title browser luôn hiển thị 'Page title - Site title'. Site wordpress 5.8, có sử dụng Yoast SEO ver 17.0.

Mục tiêu: view 'Page title' only

Lịch sử: khi gặp vấn đề tìm cách xử lý trực triếp từ theme ko hiệu quả, lên internet tìm 'Wordpress Remove title' nhiều lần tốn thời gian 2h, xem nhiều site. Thì giải pháp tốt nhất là dùng 'Yoast SEO'. Khi dùng thì chưa quen không tìm thấy vị trí setting vì mỗi phiên bản setting khác nhau. Hiện tại đang dùng Yoast version 17.0. Đúng là có setting có khác so với trên internet lúc tìm kiếm, nên tốn thời gian.

Tình trạng: SOLVED - 2021 August 27

Hình ảnh ghi nhận:



Chủ Nhật, 4 tháng 4, 2021

Joomla 3.9.x Missing install from (folder, upload, url)

Description: upgrade older version to joomla 3.9.x -> missing install tab item (folder, upload, url)

Solution: Administrator-> Menu Extension -> Update -> tab Discover -> choose type Install -> Re-install




Joomla upgrade 3.5.1 to 3.6.5 then 3.9.x

NOTE: REQUIRE BACKUP BEFORE CONTINUE

Step 1: upgrade 3.5.1 to 3.6.5

1.1: Upgrade direct from administator

1.2: Or download Joomla_3.6.5-Stable-Update_Package.zip then extract

Result require: version 3.6.5: DONE


Step 2: upgade joomla 3.6.5 to joomla 3.9.x

Upgrade direct at administrator

Result require: run 100% 


Step 3: 1054 Unknown column a.client_id - Fix error from phpmyadmin

Replace # by database prefer

ALTER TABLE `#_menu_types` ADD COLUMN `client_id` int(11) NOT NULL DEFAULT 0;

UPDATE `#_menu` SET `published` = 1 WHERE `menutype` = 'main' OR `menutype` = 'menu';

Result require: Run site normal


Step4: Database error

Run database fix




Require required: articles, category, modules good work

Thứ Tư, 10 tháng 2, 2021

joomla com_newsfeed load blogspot url change image size


Description: load feed from blogspot.com image reduce 300px, 400px. Need upto 1024px

File edit: com_newsfeeds\views\newsfeed\tmpl\default.php

Line 133:

<?php echo str_replace('&apos;', "'", $text); ?>

Change to:

<?php 

$text = str_replace('/s320/', '/s1024/', $text);

$text = str_replace('/s400/', '/s1024/', $text);

echo str_replace('&apos;', "'", $text); ?>


Image result



Thứ Ba, 26 tháng 11, 2019

PHP - Get Country Code by live IP

Detail: function in region area or coutry
Solution: PHP get live IP from browser, get from http://www.geoplugin.net/json.gp?ip=1.2.3.4

<?php
// PHP code to obtain country, city,
// continent, etc using IP Address
 
//$ip = '52.25.109.230';
$ip= $_SERVER [ "REMOTE_ADDR" ];
 
// Use JSON encoded string and converts
// it into a PHP variable
$ipdat = @json_decode(file_get_contents(
    "http://www.geoplugin.net/json.gp?ip=" . $ip));
//print_r($ipdat);
echo 'Your IP: ' . $ip . "<br/>";
echo 'Country Name: ' . $ipdat->geoplugin_countryName . "<br/>";
echo 'Country code: ' . $ipdat->geoplugin_countryCode . "<br/>";
echo 'City Name: ' . $ipdat->geoplugin_city . "<br/>";
echo 'Continent Name: ' . $ipdat->geoplugin_continentName . "<br/>";
echo 'Latitude: ' . $ipdat->geoplugin_latitude . "<br/>";
echo 'Longitude: ' . $ipdat->geoplugin_longitude . "<br/>";
echo 'Currency Symbol: ' . $ipdat->geoplugin_currencySymbol . "<br/>";
echo 'Currency Code: ' . $ipdat->geoplugin_currencyCode . "<br/>";
echo 'Timezone: ' . $ipdat->geoplugin_timezone;
?>

Thứ Hai, 25 tháng 11, 2019

PHP string Serialize Corrector SOLVED

Reason: many string Serialize NOT right format
Solution: check and correction  string. Check many times on internet
Source : from internet. Not remember exactly. So thanks for all

 /*Serialize Corrector*/
 function serialize_corrector($serialized_string){       
        if ( @unserialize($serialized_string) !== true &&  preg_match('/^[aOs]:/', $serialized_string) ) {
             $serialized_string = preg_replace_callback( '/s\:(\d+)\:\"(.*?)\";/s',    function($matches){return 's:'.strlen($matches[2]).':"'.$matches[2].'";'; },   $serialized_string );
        }
        return $serialized_string;
    }