Showing posts with label Wordpress. Show all posts
Showing posts with label Wordpress. Show all posts

Wednesday, May 4, 2022

How to generate a link which adds product to the cart in Wordpress

In Wordpress, We can have links to add product to the cart which is required sometimes especially when sending campaign links to promote product or course and providing buy product option.

Ex:  https://www.yourwpdomain.com/?add-to-cart=3016&quantity=1

    Will add product with id 25 to the cart with qty 1

    https://www.yourwpdomain.com/?add-to-cart=3016&quantity=3

Wednesday, July 28, 2010

Artister - An automated web design tool for joomla, drupal and wordpress theming

Artisteer
It is the first and only tool for web design automation that creates fantastic eye appealing websites templates and themes for joomla, wordpress and drupal.

With Artisteer YOU immediately become a Web design expert, editing and slicing graphics, coding XHTML and CSS, and creating Web Design Templates, Joomla templates, Drupal themes,
Wordpress themes, DotNetNuke skins, and Blogger templates all in minutes, without Photoshop or Dreamweaver, and no technical skills.

Official website: http://www.artisteer.com

Xcloner - For backup and restore Joomla, Drupal, Wordpress and All PHP/Mysql Websites

Hellow friends,

Xcloner is a tool to backup and restore feature for Joomla, Dupal, Wordpress and all PHP/Mysql Projects. You should should like xcloner for wordpress etc., in google for more info.

For Wordpress
http://www.devplug.net/

For Joomla
http://www.joomlaplug.com/Documentation/XCloner_Documentation/XCloner_-_Standalone_Backup_and_Restore.html

Wordpress Vs Joomla Vs Drupal

WORDPRESS
It is just for blogging systems and few cms pages manage through WYSIWYG Editor without more complex form fields integration.

Wordpress Pros
* Simple to use - No need for modifications
* Excellent for blogging or sharing thoughts in a sequential manner
* Even the most elderly of users can get the hang of it quickly

Wordpress Cons

* Not developer friendly
* The community seems to like to complain
* Upgrades bring more bugs than fixes sometimes


# DRUPAL
It is for developers and can hand-code the content of your pages than use a WYSIWYG Editor, or if you enjoy tweaking the code that makes up the framework of a website, then Drupal is probably for you.

Drupal Pros

* Extremely developer friendly. If I loved code more I would almost always pick this system.
* Strong community to help discern the dozens (hundreds) of functions and tags available.
* Can be used to create some really awesome websites that can outperform a majority of other sites out there.

Drupal Cons

* Not very designer and user-friendly. It's hard for someone with little code knowledge to make the leaps required to do the very cool things that Drupal is becoming known for.
* Theming of Drupal has been a huge case of fail (until recently). Probably because it has been developers, not designers, that are making the themes.
* Getting a Drupal website published could cost you more time, and thus more money, than Wordpress or Joomla.


# JOOMLA
It is userfriendly for all type of people i.e designers, developers and admins. Where as it is not so powerful as compare to Drupal.

Joomla Pros

* Friendly for all types of users - Designers, Developers and Administrators
* Huge community is awesome for assisting with creation of websites
* Has been rapidly growing and improving itself for the past three years

Joomla Cons

* Still not user-friendly enough for everyone to understand
* Not quite as powerful as Drupal, and can be a bit confusing for some to jump into
* Recently rebuilt the entire system from ground-up, and so there are still many out there sticking to the old versions (1.0.x)


Drupal Modules: Drupal.org DrupalModules Best Modules BestRank Noupe Appnovation GUI Designer


Drupal Themes: Drupal.org Theme Garden FreeDrupalThemes ThemeBot Mulpo MogDesign GeekTip

Joomla Modules/Extensions: Joomla.org 10 Best Free Joomla21 AJAXLine evoHosts


Joomla Templates: Joomla.org BestofJoomla TemplateMonster Joomla24 Freetemplates Templates.com

Wordpress Plugins: WordPress.org SiteSketch WPHacks VisionWidgets Sadhas BestWordPressPlugins


WordPress Themes: WordPress.org bestwpthemes PageLines TopWPthemes Themes2WP LeVoltz


Ref: http://www.goodwebpractices.com/other/wordpress-vs-joomla-vs-drupal.html

Monday, July 26, 2010

Use mysql_real_escape_string() function to avoid mysql injections

// Query database to check if there are any matching users
$query = "SELECT * FROM users WHERE user='{$_POST['username']}' AND password='{$_POST['password']}'";
mysql_query($query);

// We didn't check $_POST['password'], it could be anything the user wanted! For example:
$_POST['username'] = 'admin';
$_POST['password'] = "' OR ''='";
// This means the query sent to MySQL would be:
echo $query;
?>

The query sent to MySQL as:

SELECT * FROM users WHERE user='admin' AND password='' OR ''=''

This would allow anyone to log in without a valid password.


Solution:
// Query
$query = sprintf("SELECT * FROM users WHERE user='%s' AND password='%s'",
mysql_real_escape_string($_POST['user']),
mysql_real_escape_string($_POST['password']));
?>
Here mysql_real_escape_string function prepends backslashes to the following characters: \x00, \n, \r, \, ', " and \x1a to make data safe before sending a query to MySQL. So user can't hack your database.

Saturday, July 24, 2010

Wordpress Vs Drupal

Hi, here is my view about where to use wordpress and where to use drupal.

Wordpress
# If your application doesn't contain so many dynamic content forms and have to manage some static pages of information and need a bloging system.

It should suitable company portfolio sites and simple to medium level websites.

Drupal
# If you have multiple dynamic content types (press releases, news articles, blog posts, etc.). Drupal is great at allowing you to create this stuff on the fly, with Wordpress you are hacking things together.
# If your site has more than a two template design structure (homepage and second levels).
# If you have numerous content blocks on the homepage or in sidebars that you will be editing frequently. Drupal’s block system is great at this kind of stuff.
# If you are trying to start small and expect your site to add tons of features/content moving forward.
It should suitable for complex websites which involves so many modules.

Monday, June 28, 2010

Wordpress plugin development

Hi Friends,

Here is very good information provided for wp plugin developement, it explained in a very easy way.

http://www.problogdesign.com/wordpress/a-novice-guide-to-wordpress-plugin-development/

Friday, June 18, 2010

Move Wordpress to another host

Simple process to get work.

Wordpress application run in another host or another url.

Wordpress will configure all the paths in database only, ex: when you upload any image, its absolute path stored in database. And all content will reside in wp-content folder.

New host
1. First install new wordpress in new host

Old host
2. Take mysql backup from old site. or goto Tools -> Import in wp-admin.
This should be used later for running old application

Old host
3.
Login admin panel of old site, Goto settings -> General
change WordPress address (URL) and Blog address (URL) against new host and click "Save Changes"
Now the database will updated with new host urls.

4. Old host
Goto phpmyadmin and export the database or goto Tools -> Export in wp-admin.

5. Old host
Revert back the database with old one, i.e we took backup on step-2.

New host
6. Import the old application's database which we get from step 4.

New host
7. Copy the wp-content folder from old host and pasted it into new host.

Now, upon completion of these steps we can sucessfully run the same application in both the hosts.

( OR )

You can copy all the files from old server and pasted it in new server and follow below process.

wp-config.php is the main configuration file for database connections and others.

Edit wp-config.php file to suit with your database
//DB_USER etc.,

Open database goto wp_options table and change the below two rows

option_value='your-new-url' where option_name='site url' and
option_value='your-new-url' where option_name='home'.

If you didn't change this siteurl value in this table your site will connect to old site when you try to access admin panel.

After done, goto /wp-admin section through browser and enter admin details.
Then goto Settings -> General -> change urls.
Now site configured and worked properly in new server or localhost.

In database replace every occurance of http://oldserver/wp-content links with http://newserver/wp-content. So that image links are worked currectly.

Some settings are fixed in wp-settings.php file.


Complete Reference

http://www.dollarshower.com/move-wordpress-blog-to-another-host-server/

http://support.hostgator.com/articles/pre-sales-questions/how-to-transfer-your-wordpress-blog-from-one-host-to-another-host

http://www.makeuseof.com/tag/move-wordpress-blog-host/







Custom fields in wordpress
http://codex.wordpress.org/Using_Custom_Fields

Move Wordpress to another host

http://www.dollarshower.com/move-wordpress-blog-to-another-host-server/

http://support.hostgator.com/articles/pre-sales-questions/how-to-transfer-your-wordpress-blog-from-one-host-to-another-host

http://www.makeuseof.com/tag/move-wordpress-blog-host/



Bigdump used to import large databases
http://www.ozerov.de/bigdump.php

Thursday, May 13, 2010

Different styles for each post in wordpress

Use below process to set different styles for different posts

$postid=$post->ID;

if($postid == 88)
{
$newclass = 'some-css-class-name';
}

h3 class="<= $newclass;?>" > $the_title /h3

Tuesday, May 4, 2010

Custom page background for each post in Wordpress

Hi,

You can have custom background for each post in word press by using a plugin. Find the plugin info at below url.
ttp://www.blogtap.net/the-custom-post-background-wordpress-plugin/

Tuesday, April 27, 2010

Wordpress usefull URLs

Function reference
http://codex.wordpress.org/Function_Reference/wpdb_Class#INSERT_rows

Beginner guide
http://www.wpbeginner.com/wp-tutorials/useful-wordpress-configuration-tricks-that-you-may-not-know/


Custom fileds
http://millionclues.com/problogging/wordpress-tips/wordpress-custom-fields-tutorial-for-total-newbie/
Featured Gallery
http://www.featuredcontentgallery.com/
http://millionclues.com/problogging/wordpress-tips/custom-image-and-link-for-each-post-using-custom-fields/
Custom fileds
http://codex.wordpress.org/Using_Custom_Fields
Custom fileds
http://perishablepress.com/press/2008/12/17/wordpress-custom-fields-tutorial/
Top 10 galleries
http://techpp.com/2009/06/18/top-10-wordpress-gallery-plugins/
Galleries
http://codex.wordpress.org/Photoblogs_and_Galleries
http://smartboydesigns.com/2009/05/08/7-superb-wordpress-photo-gallery-plugins/
http://en.support.wordpress.com/images/gallery/

Themes
http://themeforest.net/

Resources
http://erkcm.wordpress.com/2010/03/29/300-resources-to-help-you-master-wordpress/

Monday, March 15, 2010

Multiple layouts for each Wordpress Page

The solution:
Edit ‘page.php’ to check what page your on, and then load the appropriate template.

The implementation:
If you edit page.php you’ll notice that it calls the get_header() and get_footer() functions. This is about the only bit of code that we want to keep in this file.

First Step:
First, make a copy of page.php and give it a name. This is your first template. Delete the header and footer calls from your template, because we’re going to load this into page.php, and it will have already called them.

Second Step:
Open page.php and delete everything between the header and footer calls. In this space, add a PHP conditional that uses the is_page() function.

if(is_page(107) == true) {
include ‘page_full.php’;
} else {
include ‘page_twocolumn.php’;
}

?>

Here’s an example of what I did to load multiple page layouts:

if(is_page(107) == true) {
include ‘page_films.php’;
} else if(is_page(array(518, 28, 13)) == true) {
include ‘page_full.php’;
} else {
include ‘page_twocolumn.php’;
}

?>

This sets page with ID 107 to use the template specific for the ‘films’ page. It also sets pages with ID’s 518, 28, and 13 to use the full page layout. All others use the two column layout.

That’s it!