Posted by paris on Feb 16, 2013 in
Code
A customer wanted to show visitors when the last modification to the whole wordpress site was on the home page. There’s a function in WordPress which give you the function to the current post or page which is :
the_modified_time('F j, Y');
However to find out the whole site, you need to do the current MySQL Query :
$last_site_update = $wpdb->get_var( “SELECT post_modified FROM $wpdb->posts WHERE post_status = ‘publish’ ORDER BY post_modified DESC LIMIT 1″ );
Then you can formulate it with PHP’s Date Function e.g. : echo date(‘F j, Y’, strtotime($last_site_update));
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Tags: wordpress last update time, wordpress site last update date
Posted by paris on May 2, 2012 in
Code
As per title , the wordpress plugin Per Page Sidebars does not work when you enable a widget for 2 pages which have same names. I was building a site which had duplicate children page names for multiple parents.
I modified the plugin to register the widgets from PSS-Name-of-Page to PSS-Name-of-Parent-Name-of-Page
This enabled me to have multiple widgets for pages by the same name , and also an easy way to organise the widgets in the backend. Code modify in the per-page-sidebars.php file
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Posted by paris on Feb 29, 2012 in
Code
Go into /wpsc-theme/functions/wpsc-transaction_results_functions.php
Comment out the following
wp_mail( $email, __( ‘Order Pending: Payment Required’, ‘wpsc’ ), $message );
wp_mail( $email, __( ‘Purchase Receipt’, ‘wpsc’ ), $message );
wp_mail( get_option( ‘purch_log_email’ ), __( ‘Purchase Report’, ‘wpsc’ ), $report );
VN:F [1.9.22_1171]
Rating: 1.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Posted by paris on Sep 18, 2011 in
Code

The page here has a solution however it doesn’t work : http://wpquestions.com/question/show/id/1840 and the topic is closed hence for this post!
You need to edit this file : wpsc-transaction_results.php
I placed my code after the true statment for correct purchase
if ( ( true === $echo_to_screen ) && ( $cart != null ) && ( $errorcode == 0 ) && ( $sessionid != null ) ) {
The value you need is $cart[0][prodid];
There are 2 array’s you can get information from $purchase_log and $cart
VN:F [1.9.22_1171]
Rating: 3.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Tags: How to get the product ID on the WP Ecommerce Transaction Results Page
Posted by paris on Aug 4, 2011 in
Code
Recently a collegue contacted me for some help with his university degree. The project was to create a website that was backed by a database. My background is mainly PHP and MySQL however, the course had been teaching them how to manipulate an MDB Access Database file using ASP. The outline of the task was a document management system for projects.
- A user would enter their unique company number into a page
- It would list available projects for that company
- User would select the project and login with a username and password
- The website would list all files which he had permission to access
The tutorials the lecturer had given out used dreamweaver to create the ADODB.Connection , however it seemed an over complicated way of doing it. After a bit of online research my first ASP project is below ( Could be better but only had an evening to do it! )
index.asp
code here : http://pastebin.com/7s739FKa
This code manages the Company ID input then list the projects from that company
login.asp
Takes the project ID from index.asp and checks the permissions table after username and password verficiation for files they have access to
code here : http://pastebin.com/BmNiXZgz
db.mdb
File here : http://www.pariswells.com/upload/db.mdb
4 Tables
Users -> Username , Password and ID
Projects -> Project Name , Company ID Associated with that Project and Project ID
Permissions -> FileID and UserID
Company -> Company Name , Company Number and ID
Definitely prefer PHP to ASP!
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Tags: ASP Code to Read from a .mdb access file, Inner Join Asp, mdb asp lookup, query mbd with asp
Posted by paris on Dec 18, 2010 in
Code
I used the existing code here to generate a list of Albums and Galleries from NextGEN Gallery, then used used CSS to produce an Accordion Menu file structure
PHP Code : File Link Here Save this file in your plugins directory : nextgen-gallery/view as “album-list.php” , you can then call this in a wordpress page by using “[album id=0 template=list]” on the page
CSS Code Add this CSS to the bottom of your CSS File in your wordpress theme , edit for your own site color etc File Link Here
Once this has been done , organise your galleries and into albums , then this will start populating!
VN:F [1.9.22_1171]
Rating: 9.5/10 (2 votes cast)
VN:F [1.9.22_1171]
Tags: NextGEN Gallery Accordian Menu, NextGEN Gallery List Albums, NextGEN Gallery List Galleries, Wordpress Accordion Menu