March 11th, 2009
If you changed your table prefix and got the following error:
You do not have sufficient permissions to access this page
Here is a simple way to solve it.
You can go to mysql manager (phpmyadmin) –> go to (prefix)_usermeta table –> change all wp_ to your new prefix
go to (prefix)_options –> change wp_user_roles to (new-prefix)_user_roles
It will solve your permission problem.
Posted in wordpress | No Comments »
March 4th, 2009
I changed most of my sites to Nginx. I just love the peformance and memory usage (compare with apache). For those people who are using Nginx + phpbay pro. Here is the rewrite rule. Just copy and paste into your conf file, it should work without problem.
Thanks for helpful people in Nginx mailing list who contribute the following code.
rewrite ^/images/e/(.*)$ http://thumbs.ebaystatic.com/pict/$1 permanent;
rewrite ^/item-(.*)_(.*)_(.*)_(.*).html$
/auction.php?title=$1&item=$2&country=$3&ccid=$4
last;
rewrite ^/item-(.*)_(.*)_(.*).html$
/auction.php?title=$1&item=$2&country=$3
last;
rewrite ^/item-(.*)_(.*).html$
/auction.php?title=$1&item=$2
last;
Posted in nginx | No Comments »
January 10th, 2009
I got problem to install mod_geoip in my server. So I use the most simple method to redirect users. I just use a php script to do it. Here is a script to redirect user based on their countries by using geoip.dat.
[sourcecode language='php']
/**
* Case Study - GeoIP Redirection
*
* @version $Id$
* @package geoip
* @copyright © 2006 Lampix.net
* @author Dragan Dinic
*/
require_once(”geoip/geoip.inc”);
$gi = geoip_open(”geoip/GeoIP.dat”,GEOIP_STANDARD);
$country_code = geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']);
geoip_close($gi);
if($country_code == ‘CS’)
{
header(”HTTP/1.1 301 Moved Permanently”);
header(’Location: http://www.example.net/1/’);
}
else
{
header(”HTTP/1.1 301 Moved Permanently”);
header(’Location: http://www.example.net/2/’);
}
?>
[/sourcecode]
Change the geoip/geoip.inc and geoip/GeoIP.dat path accordingly.
Change if($country_code == ‘CS’) to your desire country code.
Change header(’Location: http://www.example.net/1/’); to your desire URL.
That’s it! Easy!
Posted in Mis | 1 Comment »
May 19th, 2008
I found a script which can import csv file to wordpress. Thanks Zack for posting the original csv import script. I asked a programmer to modify the script(I am not a coder anyway :-)). Here are the changes:
- tags support
- multiple categories in one column
CSV sample:
wp_title|wp_post_date|wp_category|wp_content|wp_tags|field1|field2|field3….
title1|2008-05-14 23:59:59|cat1,cat2|long text content|tags1,tags2,tags3|extra field|some extra fields|other extra fields
Please use Category Slug in the csv file.
You can get the script here
Posted in wordpress | 34 Comments »
March 20th, 2008
Something about Site2nd.org
Site2nd.org is a site for mirroring services. If you want to mirror your site or download files, please contact us.
Here are the list of sites that already mirror in our server:
putty.site2nd.org
kerneltraffic.site2nd.org
xemacs.site2nd.org
analog.site2nd.org
sudodownload.site2nd.org
imagemagick.site2nd.org
qmailrocks.site2nd.org
openmpi.site2nd.org
curl.site2nd.org
qmail.site2nd.org
openssl.site2nd.org
exim.site2nd.org
isc.site2nd.org
pine.site2nd.org
wuftpd.site2nd.org
gimp.site2nd.org
openldap.site2nd.org
postfix.site2nd.org
sendmail.site2nd.org
vim.site2nd.org
webalizer.site2nd.org
lynx.site2nd.org
modssl.site2nd.org
Posted in Site 2nd News | No Comments »
November 20th, 2007
I asked a programmer to modify the Zenphotopress plugin, so that people can use a simple code and display the whole gallery in a wordpress post or page.
For example:
[zenphotopress]gallery=109[/zenphotopress]
This will display all the thumbnails of the gallery 109 (id in the album table) and link to the image directly.
I think that programmer also fix a problem of the script. The script seems can’t display the thumbs correctly I think it should work now.
I also sent the script to Simbul, see if he’s willing to include my modifictioans in his script.
You can download the script here
Installation:
- Just install it like normal wordpress plugin
- Set your zenphoto database under wordpress database
- If you use mod_rewrite, remember to edit the .htaccess in order to show the correct path of your zenphoto directory
- If you want to see the database id in your theme, you can use “id: <?php echo getAlbumID();?>” in your theme
Posted in Zenphoto | No Comments »