Skip to content

Instantly share code, notes, and snippets.

@mgsolipa
mgsolipa / _coll_item_list.widget.php
Created July 11, 2015 09:40
[b2evolution] Enable/Disable categories links in Universial Items Widget (i7)
<?php
/**
* This file implements the xyz Widget class.
*
* This file is part of the evoCore framework - {@link http://evocore.net/}
* See also {@link https://github.com/b2evolution/b2evolution}.
*
* @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
*
* @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}
@mgsolipa
mgsolipa / _skin.class.php
Last active August 29, 2015 14:22
Get the thumbnail of a given video from Youtube or Vimeo
// ... add this to your _skin.class.php ...
/**
* The following methods have been added in order to get the thumbnail of a given video
*
* In order to make this work, you should do the following:
*
* 1. Add these functions to the _skin.class.php file of your skin
* 2. Create a text custom field called "video_thumb"
* 3. Add a section of code in the posts.main.php file, just above the ITEM BLOCK section
@mgsolipa
mgsolipa / _functions_evoupgrade.php
Created April 27, 2015 06:22
b2evolution - Moving code to a different block in order to support upgrades from 1.10 to 5.2.2
<?php
/**
* This file implements upgrading of DB tables
*
* b2evolution - {@link http://b2evolution.net/}
* Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
* @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
*
* {@internal Open Source relicensing agreement:
* Daniel HAHLER grants Francois PLANQUE the right to license
@mgsolipa
mgsolipa / _videoplug.plugin.php
Last active August 29, 2015 14:17
b2evolution - Video plugin
<?php
/**
* This file implements the Video Plug plugin for b2evolution
*
* b2evolution - {@link http://b2evolution.net/}
* Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
* @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
*
* @package plugins
*/
@mgsolipa
mgsolipa / index.main.php
Created January 13, 2015 20:13
Small modification to manage custom login and $login_required = true
<?php
/**
* This is the main/default page template.
*
* For a quick explanation of b2evo 2.0 skins, please start here:
* {@link http://b2evolution.net/man/skin-structure}
*
* The main page template is used to display the blog when no specific page template is available
* to handle the request (based on $disp).
*
@mgsolipa
mgsolipa / profile.main.php
Created October 17, 2014 06:35
b2evolution 4.1.7 - Mystique skin - profile.main.php
<?php
/**
* This skin only uses one single template which includes most of its features.
* It will also rely on default includes for specific dispays (like the comment form).
*
* The main page template is used to display the blog when no specific page template is available
* to handle the request (based on $disp).
*
* b2evolution Mystique skin v2.0.1
*
@mgsolipa
mgsolipa / gist:efe588f36f1104e2d957
Created October 4, 2014 12:15
Fancybox plugin example (including Buttons and Thumbnails helpers)
<a class="fancybox-button" rel="fancybox-button" href="http://farm4.staticflickr.com/3787/9028269192_9b4ddf345d_b.jpg" title="Tolpis barbata (mariluzpicado)">
<img src="http://farm4.staticflickr.com/3787/9028269192_9b4ddf345d_m.jpg" alt="" />
</a>
<a class="fancybox-button" rel="fancybox-button" href="http://farm4.staticflickr.com/3745/8971419780_cb88b22947_b.jpg" title="(dSavin)">
<img src="http://farm4.staticflickr.com/3745/8971419780_cb88b22947_m.jpg" alt="" />
</a>
<a class="fancybox-button" rel="fancybox-button" href="http://farm9.staticflickr.com/8522/8478415115_152c6f5e55_b.jpg" title="a ride in blue? (cembayir_photography)">
<img src="http://farm9.staticflickr.com/8522/8478415115_152c6f5e55_m.jpg" alt="" />
</a>
<a class="fancybox-button" rel="fancybox-button" href="http://farm9.staticflickr.com/8366/8483546751_86494ae914_b.jpg" title="reedit... (h_di)">
@mgsolipa
mgsolipa / customfile.php
Created August 21, 2014 08:23
Moodle - Get a file stored in the disk overriding the regular file system methods
<?php
/**
* Get a file stored in the disk overriding the regular file system methods
*
* DISCLAIMER:
* This is just a proof of concept script, use it under your own risk.
*
* Use:
*
* $path = 'foo/bar';
@mgsolipa
mgsolipa / index.main.php
Created May 31, 2014 08:44
Index file of the Mystique skin for b2evolution. Conditional layout according the value of a custom disp.
<?php
/**
* This skin only uses one single template which includes most of its features.
* It will also rely on default includes for specific dispays (like the comment form).
*
* The main page template is used to display the blog when no specific page template is available
* to handle the request (based on $disp).
*
* b2evolution Mystique skin v2.0.1
*