Archive for December, 2009

  • Happy new year!

    Date: 2009.12.31 | Category: 2010 | Response: 0

    The world can throw what it wants at us, we’re ready!
    Above worldle from this source
  • what type of 3d is avatar?

    Date: 2009.12.29 | Category: 3d, films | Response: 0

    Stereoscopic 3D,” – which mixes live-action and CGI imagery in a seamless blend. The film is shot with a Fusion 3-D camera. Don’t get too excited though, you still need glasses.
    Cameron truly did break boundaries with Avatar so all I can say is, please make a new star wars with this tech, it would be amazing!
    Maybe the most significant thing I took from avatar was the 3d experience. Let’s hope there is more of this calibre to come. P.S I watched it at the Imax, Bradford
  • PHP to create Elgg pages from a mysql database

    Date: 2009.12.29 | Category: Php, elgg, mysql | Response: 0

    Installation:
    1. Save to below script to the root of your Elgg install as importelgg.php
    2. Change the bits in bold to suit your environment.
    3. Log into your elgg site as the user you want to upload as then browse to the script.
    Code:
    <?php
    // Modified from edit.php from Elgg doc’s by John McLear – www.mclear.co.uk
    set_time_limit(0); // We dont want the script to time out
    require_once ‘engine/start.php’;
    // Load configuration
    global $CONFIG;
    $dbhost = ‘localhost‘; // The MySql Hostname
    $dbuser = ‘root‘; // MySQL Username
    $dbpass = ‘yourpassword‘; // MySQL Password
    $conn = mysql_connect($dbhost, $dbuser, $dbpass, TRUE) or die (‘Error connecting to mysql’); // TRUE so we dont overwrite connection
    $dbname2 = ‘mydatabase‘; // The databasename
    mysql_select_db($dbname2);
    $sql=”SELECT title,contents FROM pages“; // Get the content from the source database
    $result=mysql_query($sql);
    // Go through the records and create what you need from that
    while ($row=mysql_fetch_array($result)) {
    $title=$row["title"]; //Set the title value from the mysql title field
    $content=$row["contents"]; // Same as above but for contents
    gatekeeper();
    set_context(‘pages’);
    // Get group fields
    $input = array();
    foreach($CONFIG->pages as $shortname => $valuetype) {
    $input[$shortname] = get_input($shortname);
    if ($valuetype == ‘tags’)
    $input[$shortname] = string_to_tag_array($input[$shortname]);
    }
    // Get parent
    $parent_guid = (int)get_input(‘parent_guid’, 0);
    // New or old?
    $page = NULL;
    $pages_guid = (int)get_input(‘pages_guid’);
    if ($pages_guid)
    {
    $page = get_entity($pages_guid);
    if (!$page->canEdit())
    $page = NULL; // if we can’t edit it, go no further.
    }
    else
    {
    $page = new ElggObject();
    if (!$parent_guid)
    $page->subtype = ‘page_top’;
    else
    $page->subtype = ‘page’;
    // New instance, so set container_guid
    $container_guid = get_input(‘container_guid’,’8849‘); // Set the container GUID to a static user
    $page->container_guid = $container_guid;
    }
    // Have we got it? Can we edit it?
    if ($page instanceof ElggObject)
    {
    // Save fields – note we always save latest description as both description and annotation
    if (sizeof($input) > 0)
    {
    foreach($input as $shortname => $value) {
    if ((!$pages_guid) || (($pages_guid) && ($shortname != ‘title’)))
    $page->$shortname = $value;
    }
    }
    // Validate create
    $page->title = $title;
    if (!$page->title)
    {
    register_error(elgg_echo(“pages:notitle”));
    forward($_SERVER['HTTP_REFERER']);
    exit;
    }
    // Access ids (Make it public)
    $page->access_id = 2;
    // Get the content
    $page->description = $content;
    // Write access id (Make it public)
    $page->write_access_id = 2;
    // Set parent
    $page->parent_guid = $parent_guid;
    // Ensure ultimate owner
    $page->owner_guid = ($page->owner_guid ? $page->owner_guid : $_SESSION['user']->guid);
    // finally save
    if ($page->save())
    {
    // Now save description as an annotation
    $page->annotate(‘page’, $page->description, $page->access_id);
    system_message(elgg_echo(“pages:saved”));
    //add to river
    add_to_river(‘river/object/page’,'create’,$_SESSION['user']->guid,$page->guid);
    echo “$title – DONE<br/>”;
    }
    else
    register_error(elgg_echo(‘pages:notsaved’));
    }
    else
    {
    register_error(elgg_echo(“pages:noaccess”));
    }
    usleep(250000); // Just a little rest not to be overspammy
    }
    ?>
  • Maximum Etherpad limit users per pad

    Date: 2009.12.29 | Category: etherpad | Response: 0

    Quotas.js restricts this and by default reads:

    function getMaxSimultaneousPadEditors(globalPadId) {
    if (isProDomainRequest()) {
    if (pne_utils.isPNE()) {
    return licensing.getMaxUsersPerPad();
    } else {
    return 1e6;
    }
    } else {
    // etherpad.com public pads
    if (globalPadId && stringutils.startsWith(globalPadId, “conf-”)) {
    return 64;
    } else {
    return 32;
    }
    }
    return 1e6;
    }
    function getMaxSavedRevisionsPerPad() {
    if (isProDomainRequest()) {
    return 1e3;
    } else {
    // free public etherpad.com
    return 100;
    }
    }
    So to summarize:
    Depending on the mode you are in depends on the amount you have
    Non-Pro –>
    Max per time on 1 pad: 64
    Max revisions: 100
    Pro –>
    Max per time: Unlimited
    Max revisions: Unlimited
  • CBBC News wordpress plugin / widget

    Date: 2009.12.27 | Category: WPMU, WordPress, cbbc, ict, news, plugins | Response: 0

    The CBBC News plugin / widget is now available on Primary Blogger under plugins.

    1. Log in
    2. Click Appearance > Widgets
    3. Drag the CBBC News feed onto your sidebar
    4. Visit your blog
    5. Bask in your champion’ness
    View the bottom of this schools blog to see it in action

Latest chatter

Posting tweet...

Sponsored by

Primary Games Arena
 
 
 
 
 
 
 
 

Links