Skip to content

Instantly share code, notes, and snippets.

View ntwb's full-sized avatar
🏠
Working from home

Stephen Edgar ntwb

🏠
Working from home
View GitHub Profile
@ntwb
ntwb / gist:2222965
Created March 28, 2012 02:24
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@ntwb
ntwb / gist:3133449
Created July 18, 2012 01:22
bbPress custom bbp_list_forums
<?php
// Custom bbp_list_forums bbPress code by @Lynq
// Demo: http://teamoverpowered.com/forums/
// Code Discussion: http://bbpress.org/forums/topic/customising-bbp_list_forums-last-poster-block/
public function custom_bbp_list_forums( $args = '' ) {
// Define used variables
$output = $sub_forums = $topic_count = $reply_count = $counts = '';
$i = 0;
@ntwb
ntwb / gist:3133450
Created July 18, 2012 01:22
bbPress custom last_poster_block
<?php
// bbPress custom last_poster_block code by @Lynq
// Demo: http://teamoverpowered.com/forums/
// Code Discussion: http://bbpress.org/forums/topic/customising-bbp_list_forums-last-poster-block/
/** Last poster / freshness block for forums */
public function custom_last_poster_block( $subforum_id = "" ) {
echo BBP_Default::custom_get_last_poster_block( $subforum_id = "" );
}
@ntwb
ntwb / gist:3133451
Created July 18, 2012 01:22
bbpress custom last_poster_block_topics
<?php
// bbpress custom last_poster_block_topics code by @Lynq
// Demo: http://teamoverpowered.com/forums/
// Code Discussion: http://bbpress.org/forums/topic/customising-bbp_list_forums-last-poster-block/
/* Last poster / freshness block for topics */
public function custom_last_poster_block_topics() {
echo BBP_Default::custom_get_last_poster_block_topics();
}
@ntwb
ntwb / ntwb_bbpress_list_forums.php
Last active October 11, 2015 03:47
bbPress - Custom Forum List
<?php
/*
Plugin Name: bbPress - Customised forum list arguments
Plugin URI: https://gist.github.com/ntwb/3797945
Description: bbPress - Customised forum list arguments
Version: 0.3
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
@ntwb
ntwb / ntwb_bbpress_show_lead_topic.php
Last active October 11, 2015 06:17
bbPress - Show Lead Topic
<?php
/*
Plugin Name: bbPress - Show Lead Topic
Plugin URI: https://gist.github.com/ntwb/3815686
Description: bbPress - Show Lead Topic
Version: 0.2
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
@ntwb
ntwb / Mingle.php
Last active December 11, 2015 02:58 — forked from anonymous/gist:4534163
<?php
/**
* Implementation of Mingle Forums converter.
*
* @since bbPress (r4689)
*/
class Mingle extends BBP_Converter_Base {
/**
@ntwb
ntwb / Vanilla.php
Last active December 11, 2015 17:18 — forked from brokentwig/Vanilla2.php
<?php
/**
* Implementation of Vanilla 2.0.18.1 Converter
*
* @since bbPress (r4717)
* @link Codex Docs http://codex.bbpress.org/import-forums/vanilla
*/
class Vanilla extends BBP_Converter_Base {
SELECT `forum`.`ID`, `forummeta`.`meta_value`, `group`.`id`
FROM `wp_posts` AS `forum`
LEFT JOIN `wp_postmeta` AS `forummeta`
ON `forum`.`ID` = `forummeta`.`post_id`
AND `forummeta`.`meta_key` = '_bbp_old_forum_id'
LEFT JOIN `wp_bp_groups` AS `group`
ON `group`.`slug` = `forum`.`post_name`
WHERE `forum`.`post_type` = 'forum' AND `group`.`id` > 0
GROUP BY `forum`.`ID`;
post_author post_date post_content post_title
1 2013-09-01 00:37:17 Main Category Description Main Category
1 2013-09-01 00:37:17 Main Forum Description Main Forum