Thursday 22 August 2013

Social media Link for Webpage

First, choose a Share Widget style:

  • MULTI POST
    Sharing takes place inside the widget, without taking users away from your site. Preferences are saved so your users can share to more than one service at the same time.
  • DIRECT POST
    Your users will be redirected to Facebook, Twitter, etc when clicking on the corresponding buttons. The widget is opened when users click on "Email" and "ShareThis".
By downloading the code, you agree electronically to the publisher terms of useprivacy policy, and are at least 13 years old.
  • Copy the span tags and place them where you want your buttons to appear in the code.
  • (This style is the most adaptable to any type of page design. We strongly recommend that you place them towards top of the page.)
    <span class='st_sharethis' displayText='ShareThis'></span>
    <span class='st_facebook' displayText='Facebook'></span>
    <span class='st_twitter' displayText='Tweet'></span>
    <span class='st_linkedin' displayText='LinkedIn'></span>
    <span class='st_pinterest' displayText='Pinterest'></span>
    <span class='st_email' displayText='Email'></span>
  • Copy the script tags and place them inside and at the end of your "head" tag.
  • <script type="text/javascript">var switchTo5x=false;</script>
    <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
    <script type="text/javascript">stLight.options({publisher: "0441c7af-58fc-4c7a-959d-6538cf3541df", doNotHash: false, doNotCopy: false, hashAddressBar: true});</script>
  • Check out the live Publisher Analytics Demo.
  • Want to see what the mad scientists are cookin'? Follow us on Twitter and Like us on Facebook!

Tuesday 6 August 2013

File upload size change in Moodle

Windows XP and Server 2003 based Instructions

These instructions presume that you have downloaded the latest PHP 5.3.x Windows zip package and extracted it to C:\PHP. If you have installed PHP to another location then change all references to "C:\PHP" to the location you installed PHP too.
  • Open C:\PHP
  • Right Click the php.ini file in this folder and choose "Open with..." selecting your editor of choice.
  • Press Ctrl + F and type "post_max_size" (click Find...", where needed)
  • Change the value to the number of Mb you want your site to accept as uploads
  • Press Ctrl + F and type "upload_max_filesize" (click Find...", where needed)
  • Change the value to the number of Mb you want your site to accept as uploads
  • Press Ctrl + F and type "max_execution_time" (click Find...", where needed)
  • Change the value to 600
  • Press Ctrl and S or the save button.
  • Exit your editor.
  • Restart your webserver to reload PHP with the edited changes.
    • For IIS
    • Open the Start Menu on your server and select "Run"
    • Type "iisreset /RESTART"
    • For Apache 2 and Windows XP
    • Go to Start > All Programs > Apache > Restart
    • For Apache 2 and Windows Server
    • The following command will work as long as you have installed Apache 2 as a service on your Windows Server
    • Open your Start Menu on your server and select "Run"
    • Type "httpd -k restart"
Your new file size limit should now appear in Administration > Security > Site Policies > Maximum uploaded file size
NOTE: These instructions also cover the Xampp Windows installer. Just replace C:\PHP with C:\Moodle\server\php and to restart your Moodle with a normal stop-start.

Thursday 1 August 2013

Moodle Course list in Wordpress

This plugin will allow you to display a list of Moodle courses for a specific user of Moodle.

http://wordpress.org/plugins/moodle-course-list-widget/

This section describes how to install the plugin and get it working.
Install: 1. Upload moodle-courselist-widget.php to the /wp-content/plugins/ directory 1. Activate the plugin through the 'Plugins' menu in WordPress 1. Place the new Moodle Courselist widget into your theme's sidebar.
IMPORTANT: You will need to edit the code of this plugin in 3 places in order for this to work properly. This will most likely involve a web administrator as you will need database connection settings for Moodle. This plugin is designed for use by educational institutions. Changes are clearly commented in the code with //CHANGE.
Here are the code changes you must edit:
Line 35 (Your Moodle Site URL)- action="http://yourmoodlesiteurl.com/login/index.php
Line 44 (Moodle Database Connection)- mysql_connect("localhost","MySQLusername","MYSQLpassword");
Line 76 (Your Moodle Site URL)- "http://yourmoodlesiteurl.com/course/view.php?id='.$course->courseid.'"



User Authentication Wordpress to Moodle

Wordpress to Moodle pass through authentication plugin (wordpress end)

wp2moodle--wordpress-

Wordpress to Moodle pass through authentication plugin (wordpress end). Takes the user that is logged onto wordpress and passes their details over to Moodle, enrols them and authenticates.
Note, you must to rename the zip to be just 'wp2moodle.zip' before you upload the plugin to wordpress.

Activating and configuring the plugin

  1. Upload this to your wordpress (should end up being called /wp-content/plugins/wp2moodle/)
  2. Activate the plugin
  3. Click wp2moodle on the wordpress menu
  4. Set your moodle url (e.g. http://your-site.com/moodle/)
  5. Set the shared secret. This is a salt that is used to encrypt data that is sent to Moodle. Using a guid (http://newguid.com) is a good idea. It must match the shared secret that you use on the Moodle plugin. (https://github.com/frumbert/wp2moodle-moodle)
  6. Other instructions are available on the settings page.

How to use the plugin

  1. Edit a post or a page
  2. Use the moodle button on the editor to insert shortcodes around the text you want linked
  3. When authenticated as subscriber, contributor, etc, click on the link.
Note: If the user is not yet authenticated, no hyperlink is rendered. The link does not function for Wordpress admins.

Shortcode example

[wp2moodle class='my-class' cohort='course1' target='_blank']Open my course[/wpmoodle]
class: the css classname to apply to the link (default: wp2moodle) target: the hyperlink target name to apply to the link (defaut: _self) cohort: the name of the moodle cohort in which to enrol the user
Licence:

GPL2, as per Moodle.
                                                                                                                                                  
Moodle end of a Wordpress to Moodle Single Sign On auth plugin

wp2moodle--moodle

This is the Moodle-end of a two-part plugin that allows users to authenticate within wordpress and open a Moodle site. To get the Wordpress-end plugin, check this git: https://github.com/frumbert/wp2moodle--wordpress-
Data is encrypted at the Wordpress end and handed over a standard http GET request. Only the minimum required information is sent in order to create a Moodle user record. The user is automatically created if not present at the Moodle end, and then authenticated, and (optionally) enrolled in a Cohort.

How to install this plugin

Note, this plugin must exist in a folder named "wp2moodle" - rename the zip file or folder before you upload it.
  1. Upload/extract this to your moodle/auth folder (should be called "/~/auth/wp2moodle/", where ~ is your Moodle root)
  2. Activate the plugin in the administration / authentication section
  3. Click settings and enter the same shared secret that you enter for the wp2moodle settings in Wordpress
  4. The logoff url will perform a Moodle logout, then redirect to this url. Typically this is your wordpress homepage.
  5. The link timeout is the number of minutes before the incoming link is thought to be invalid (to allow for variances in server times).
  6. Disable any other authentication methods as required. You can still use as many as you like.

Usage:

You can not use this plugin directly; it is launched by wp2moodle from within Wordpress.
Licence:

GPL2, as per Moodle.