Skip to content

Instantly share code, notes, and snippets.

View LordZombi's full-sized avatar

Zombi LordZombi

View GitHub Profile
@LordZombi
LordZombi / threedots
Created July 16, 2013 15:00
ThreeDots
JQUERY: //ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js
GITHUB: https://github.com/theproductguy/ThreeDots
<div class='text_here' style="width: 200px;">
<span class='ellipsis_text'>
TEXT
</span>
</div>
@LordZombi
LordZombi / links
Created July 16, 2013 14:25
Links
@LordZombi
LordZombi / Zend
Created July 15, 2013 14:14
If you want to select from one table but also join with another.
$select= $this->_getTable()->select()->setIntegrityCheck(false)
->from(array('BLG' => 'articles'), array('month' => new Zend_Db_Expr($m), 'count' => new Zend_Db_Expr('COUNT(BLG.id_articles)')))
->joinLeft(
array('LNG' => 'languages'),
'LNG.id_languages = BLG.id_languages',
array('lang' => 'code')
)
->where('LNG.code = ?', $lang)
;
@LordZombi
LordZombi / wordpress
Created July 15, 2013 14:03
Wordpress get all post's editors.
function getPostAuthors() {
global $wpdb;
$authors = array();
$results = $wpdb->get_results( $wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE (post_type = '%s' AND ID = %d) OR (post_type = 'revision' AND post_parent = %d) GROUP BY post_author", get_post_type( get_the_ID() ), get_the_ID(), get_the_ID() ) );
foreach ($results as $row) {
if (isset($coma)) {
echo $coma;
} else {
$coma = ', ';
}