<select name="author_id">
{exp:query sql="SELECT member_id AS member_author_id, username AS member_username, screen_name AS member_screen_name FROM exp_members"}
<option value="{member_author_id}" {if member_author_id == author_id}selected="selected"{if:elseif member_author_id == logged_in_member_id}selected="selected"{/if}>{member_screen_name}</option>
{/exp:query}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{!-- | |
// ----------------------------------------------------------------------- | |
// template_group/fullcal_demo | |
--} | |
<script type='text/javascript'> | |
// for start_on and stop_before parameters format 2011-12-25 13:00 | |
function myDate(d) { | |
return d.getFullYear() + '-' + | |
(d.getMonth() < 9 ? '0' : '') + (d.getMonth()+1) + '-' + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$query = " | |
SELECT | |
c.cat_id, cat_name, count(t.status) AS count_posts | |
FROM | |
exp_categories c | |
LEFT JOIN exp_category_posts AS p | |
ON p.cat_id = c.cat_id | |
LEFT JOIN exp_channel_titles AS t | |
ON t.entry_id = p.entry_id | |
AND t.status != 'closed' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
* This fetches the header only for a remote page. | |
* | |
* Pro's: | |
* - when fetching static stuff (images, css, html) | |
* you can first compare modified date or statuscode (304) | |
* | |
* Con's: | |
* - hitting a heavy webapp with dynamic content might be slow, | |
* you essentially hit the remote page two times |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Event Helper, set an event to april first | |
* it won't show in the channel:entries | |
* but the archive wil show an entry for april | |
*/ | |
{exp:channel:entries channel="events" | |
dynamic='no' | |
year='2012' month='04' | |
show_expired='yes' show_future_entries="yes" | |
} |
{preload_replace:preload_trick="preload_replace"}
{embed="group/template" preload='{{preload_trick}:pre_url_title="special"}'}
if called via embed you can override the preload_replace once more.
It will insert the embed-variable and parse it early.
{embed:preload}
{if segment_3==""}{preload_replace:pre_url_title="fallback"}{/if}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
- codeigniter, by default, uses persistent database connections, this is problematic in that the | |
lock is never automatically released on connection termination (what else is to expect with persistent | |
connections). However after a script ends you also never can RELEASE_LOCK() anymore, at least it didn't | |
work overhere while testing. The script really has to make sure to release the lock before ending | |
(shutdown_function) if it uses persistent DB connections. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MatchParser extends MonoParser { | |
private $first; | |
private $second; | |
public function __construct($internals, $first, $second, $callback = null) { | |
if($internals[$first] !== $internals[$second]) { | |
throw new GrammarException("Can't create a ".get_class()." first and second should be the same type"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
$plugin_info = array( | |
'pi_name' => 'Test_plugin', | |
'pi_version' => '1.0', | |
'pi_author' => 'GDmac', | |
'pi_author_url' => '', | |
'pi_description' => 'Testing stuff', | |
'pi_usage' => Test_plugin::usage() | |
); |
OlderNewer