I discovered that certain components do not create or implement SEF links when using SEF_Advance (from Sakic.Net).
For example, the URL: http://www.juicymedia.co.uk/option,com_virtuemart/page,shop.browse/category_id,1/Itemid,54/lang,en/
So we need to make the links more friendly using the “Aliases” option under the SEF_Advance administrative area. After logging in select the component from the admin menu. A list should appear (or empty if its not been used before) and the system will allow you to add a new “alias” to any static URL.
So, using the new tool I made: See Tools Menu
Paste in the none-SEF URL from the website and click the “Submit Query” button. This will generate a super-non-friendly URL which is required by the SEF_Advance alias management which looks like this:
index.php?option=com_virtuemart&page=shop.browse&category_id=1&Itemid=54&lang=en
This generated URL can then be pasted into the aliases URL followed by a description (friendly) url such as “catalogue/Land-Rover-Defender” which is then translated on the website (NB: the text is converted to lowercase automatically).
For this example, this will need doing on each category within the Virtue Mart shopping cart system.
Whilst creating this website, I realised that the mechanisms in place for saving an Microsoft Word document as HTML (filtered webpage) and then importing the source into the Jaws CMS caused quite a few issues. For example, the supposedly "filtered" saved output from MS Word is far from filtered and is likely to destroy any existing formatting that had been created by the CMS.
This got me thinking and through some simple code using a recently updated HTML Purifier, I managed to extract a filtered HTML document that was suitable for generating the articles you see on the right-hand side. Through the following code I have reduced the time it takes to convert a Word document to a fully formed XHTML document.
The PHP code is based around the PHP5 version of HTML Purifier 2.0:
$dirty_html = $_POST['q'];
if (!$dirty_html) {
echo ('You must write some HTML!');
} else {
$config = HTMLPurifier_Config::createDefault();
$config->set('Core', 'Encoding', 'ISO-8859-1');
$config->set('HTML', 'Doctype', 'XHTML 1.0 Transitional');
$config->set('HTML', 'TidyLevel', 'heavy');
$config->set('Core','AcceptFullDocuments',true);
$config->set('HTML', 'Allowed', 'a[href|title],em,p,blockquote,img');
$purifier = new HTMLPurifier($config);
$clean_html = $purifier->purify( $dirty_html );
echo $clean_html;
}
}
Access to the working demo will be available soon in a new "tools" area of the site. Of course the combination of PHP4 and PHP5 might prove interesting - maybe link to the development server might do
If you have had an error popup whilst attempting to access mambots in Joomla its most likley that your running version 1.0.11?
If so you will need to get an official fix from the Joomla forums (registration required but it's free): http://forum.joomla.org/index.php/topic,89866.msg455550.html#msg455550
Then simply upload the fix from the zip file (the zip file is called admin.mambots.php.zip) to the directory on the server containing the old file:
/administrator/components/com_mambots
This should fix the issue - Or simply upgrade to the latest version (1.0.12 at the time of writing).
I recently had an issue with IE7 and I found a suggestion on Google by a MS Developer working on the tab system. His suggestion was to try IE7 without the extensions loaded. Well, luckily this worked allowing me to identify that on my machine the Epson laser printer toolbar was at fault.
The command was: "iexplore.exe -extoff"
Ok, I have no idea where this originally came from but its been very useful the past few years for converting the standard "0000-00-00 00:00:00" format into something useable (and that the client accepts):
Whilst working various OpenSource projects I have created various functions for constructing Backbase (client edition) code through a simple PHP class (still in development).
One of the most useful functions is combobox creation.
$req_bxml = ($required)? " b:required=\"true\"" : "";
$bxml = '<b:combobox b:width="'. $size .'px" b:name="'. $name .'" b:text="'. $default .'"'. $req_bxml .'>';
foreach ($values_array as $value) {
$bxml .= '<b:combo-option b:value="'. $value['value'] .'">'. $value['name'] .'</b:combo-option>';
}
$bxml .= '</b:combobox>';
return $bxml;
}
With this code you simply pass it a name followed by an array of values. The other options allow you to define a "selected" value, then the size of the combobox and whether or not it is required. The required functionality is not yet implemented into the Backbase control so best ignore it for the time being.
This script will simply copy a series of files, tar and then gzip the files:
# temporary backup script
Back_Dir="/root/scripts/backups"
Vhosts_Dir="/home/httpd/vhosts"
# get the date for the filename.
shdate=`date +%b%d%y`
# save our current directory location.
tmp_dir=$PWD
# change to the Backup file directory.
cd $Back_Dir
# create a gzip compressed tar file of the webs directory.
tar -czf ${shdate}.bak.tar.gz $Vhosts_Dir
# return to the previous working directory.
cd $tmp_dir
It might help a few users!
Here is a simple script for optimizing MySQL table. You will need to set the username and password for a user with "admin" like privileges.
use DBI;
$dbi_host="localhost";
# all databases
@dbi_u=("admin_user");
@dbi_p=("qwerty");
#set the max count value
$ending_value = scalar(_at_dbi_u);
#loop throuogh each of the above databases
for($counter=0 ; $counter < $ending_value ; $counter++){
# connect to data input table
$dbh_in = DBI->connect("dbi:mysql:host=$dbi_host", $dbi_u[$counter], $dbi_p[$counter], { RaiseError => 0, AutoCommit => 1 }) or die "cannot connect to server" . $DBI::errstr;
$sth_dbs = $dbh_in -> prepare("SHOW DATABASES");
$sth_dbs -> execute();
for($loop_db=0; $loop_db<$sth_dbs -> rows; $loop_db++){
@row = $sth_dbs -> fetchrow_array;
# databases with a '-' in their name are not handled very well
if (index($row[0], '-') == -1){
# gen query
$sth = $dbh_in -> prepare("SHOW TABLES FROM ".$row[0]);
$sth -> execute();
$query = "";
for($loop_t=0; $loop_t<$sth -> rows; $loop_t++) {
@row2 = $sth -> fetchrow_array;
if ($query eq ""){
$query = "OPTIMIZE TABLE ";
}else{
$query .= ", ";
}
$query .= $row[0].".".$row2[0];
}
# skip databases without tables
if ($query ne ""){
print "Optimizing ".$row[0]."...\n";
$sth = $dbh_in -> prepare($query);
$sth -> execute();
}
}
}
}
All it does it loop through each database and optimise the tables. I would suggest a simple weekly or monthly cron job to execute the script. The script though will e-mail the cron user a list of optimised databases - simply add " >/dev/null 2>&1" to the end of the crontab line to send the data to nowhere.
Ok, after following ZF from its infancy I often see fundamental changes every time a new version is released. Now that the release candidate (version 1) has been released, some fundamental changes have been developed.
The following PHP code pretty much solves any issues related to converting an older pre v1 RC 1 of the ZF
. Its a slight generalisation together with the change in "toArray" in the majority of functions:
$controller->returnResponse(true);
$controller->setParam('useDefaultControllerAlways', true);
$controller->setParam('noErrorHandler', true);
$controller->setParam('noViewRenderer', true);
$response = $controller->dispatch();
The idea being that during the next release of any software that uses the above code, you re-engineer the system to cope with errors, and the new view rendering process.
This is the first posting on the new Dotcommers website which is built using a new CMS called Jaws. This CMS unlike some of the other larger-scale applications (such as Joomla) provides a very simple mechanism for inputting new articles.
The Jaws application provides extensive blogging capabilities together with sophisticated RSS and ATOM feed generation.
This "blog" as such will have articles and downloads available for anybody to view, together with many random articles relating to whatever might popup during a days work.
Category Cloud
Link Dump Tag Cloud
Today: Thursday, 21 August 2008
Categories
- AJAX (1) [atom | rss]
- General (1) [atom | rss]
- Joomla (2) [atom | rss]
- Linux Backups (1) [atom | rss]
- Miscellaneous (1) [atom | rss]
- MySQL (2) [atom | rss]
- PHP Programming (1) [atom | rss]
- Zend Framework (1) [atom | rss]
Main Menu
Articles
Tools
FileBrowser
![]() |
Applications |
![]() |
Computer_Forensics |
![]() |
Computer_Law |
![]() |
Cryptography_and_E-Commerce |
![]() |
Internet_Security |
![]() |
Joomla |
![]() |
Miscellaneous |
![]() |
Network_Security |
![]() |
Security_Management |
![]() |
Systems_Administration |
![]() |
Web_Development |
Blog Archives
- June 2007 (10)
Online Visitors:1
Today Visitors:6
Total Visitors:3811


