This post comes again from a client request. They were using the Vertical Scroll plugin for WordPress. However, they needed this scrolling box to work on their multilingual site (Chinese & English). But with this plugin, there’s no shortcode, or way to include it in a translatable page. So, I wrote a really quick plugin enhancement. Check it out, hope you find it useful:
I struggled with this for a while today. I was using SPServices’ GetListItems to pull data from SharePoint. I was using an external content type, and for the life of me could not figure out why the query was only pulling in some of my columns. The others just weren’t there. So I searched the web for a while, coming up with nothing that seemed to pertain to me. So I decided to look at my data. Turns out those columns didn’t have any data! So, in short, look at your data! I was using SPXmlToJson, as well as just the standard $.each() function to try to pull those columns; but with no data, nothing was coming back.
Bottom line: look at your data first!
The challenge this morning was to create a way for a client to embed Tudou videos (Chinese equivalent of Youtube) on their WordPress site in a really easy way. There’s nothing really out there for this, so I decided to take 30 minutes and just write my own plugin. It’s really basic, but it does the job. While I was writing it, I figured I’d also include the ability to embed Youku videos as well. It uses iframes, but could easily be modified to use the embed code or whatever. So, download and enjoy! Or just copy the script here and put in your plugins folder!
Find the ID of the video by looking in the URL of your video on Tudou or Youku. Then use that ID in the following shortcode on any post or page:
Tudou videos: [vid site="tudou" id="xxxxxx"]
Youku videos: [vid site="youku" id="xxxxxx"]
Download the plugin here: youku-tudou-embed.zip
Here’s the source code. Note: this is based on a tutorial on tutsplus.
Problem: Pull a list of reservations from a SharePoint and order them chronologically. There are three fields, firstName, lastName, and startTime. We want to pull all three fields, and then output those fields into an unordered list. As an added trick, we have several reservation lists we need to pull from (Elementary School, Middle School, and High School). So all reservations need to be pulled, and then sorted chronologically.
Solution 1: Just modify your CAML query to OrderBy the startTime field. Well, this works fine. But when pulling from multiple lists (using SPServices), the results will essentially be “grouped” by list.
Here’s the code (commented with explanations):
When you install WAMP for the first time, phpMyAdmin’s ‘root’ account does not have a password. So, when you’re trying to install WordPress it will give you an error saying it can’t make a database connection. In order to fix this (I’m in phpMyAdmin version 3.5.1), go to the “Users” section and click “Edit Privileges” next to the root user. Then scroll down and add a password.
Finally, stop WAMP services and go to C:\wamp\apps\phpmyadmin3.5.1. Edit the config.inc.php file and add a password (for me it’s on line 16):
$cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'root';
Restart WAMP services and you should be ready to go!
So I’m not entirely sure the correct method of doing this, so Nathan Rice, if you’re out there, let me know if you want to take this for your own!
WP-Cycle is a great plugin that just simply lets you upload images into a jQuery-based image slider for use in a WordPress page, theme, whatever. What I’ve done is added some functionality to the plugin that adds left/right arrows, as well as adding support for the scrollHorz, which is one of the default options from the original jQuery Cycle plugin. It’s nothing huge, but check out the code below, and if you like it, replace the wp-cycle.php file in the WP-Cycle plugin folder.
And Nathan, thanks for the great code, hope this helps! I’ve added some CSS below line 481, as well as some HTML markup between lines 415 and 432.