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
public function actionView($slug) | |
{ | |
$this->render('view',array( | |
'model'=>$this->loadModelSlug($slug), | |
)); | |
} | |
public function loadModelSlug($slug) | |
{ | |
$model = Product::model()->findByAttributes(array('slug'=>$slug)); |
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
'urlManager'=>array( | |
'urlFormat'=>'path', | |
'showScriptName' => false, | |
'rules'=>array( | |
// custom rules go first | |
'product/<slug:[a-zA-Z0-9-]+>/'=>'product/view', | |
// default controller url setup | |
'<controller:w+>/<id:d+>'=>'<controller>/view', | |
'<controller:w+>/<action:w+>/<id:d+>'=>'<controller>/<action>', | |
'<controller:w+>/<action:w+>'=>'<controller>/<action>', |
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
'about' => array('site/page', 'defaultParams' => array('view' => 'about')), | |
'example' => array('site/page', 'defaultParams' => array('view' => 'example')), |
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
'urlManager'=>array( | |
'urlFormat'=>'path', | |
'showScriptName'=>false, |
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 | |
// ADD NEW ADMIN USER TO WORDPRESS | |
// ---------------------------------- | |
// Put this file in your Wordpress root directory and run it from your browser. | |
// Delete it when you're done. | |
require_once('wp-blog-header.php'); | |
require_once('wp-includes/registration.php'); | |
// ---------------------------------------------------- |
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
//--------------------------------- | |
// EMAIL EXISTS (true or false) | |
//--------------------------------- | |
private function email_exists($email) | |
{ | |
$this->db->where('email', $email); | |
$query = $this->db->get('users'); | |
if( $query->num_rows() > 0 ){ return TRUE; } else { return FALSE; } | |
} |
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
rules: { | |
email1: { | |
required: true, | |
email: true, | |
remote: { | |
url: "/registration/register_email_exists", | |
type: "post", | |
data: { | |
email: function(){ return $("#email").val(); } | |
} |
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
<div class="sz_cont <?php echo ( ( $post->post_type=='page' ) ? "sz_page" : "sz_post" ) ?>" > | |
<a class="sz_title" href="<?php echo $url ?>"><?php echo $title ?></a> | |
<?php // GET THE FIRST IMAGE ATTACHMENT ?> | |
<?php | |
$args = array( | |
'numberposts' => 1, | |
'order'=> 'ASC', |
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
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="lt-ie9 lt-ie8 ie7" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="lt-ie9 ie8" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]--> |
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
// Found this nice function on StackOverflow, which you don't necessarily need. | |
jQuery.fn.exists = function(){ | |
return jQuery(this).length>0; | |
} | |
// Example jQuery Code | |
$(document).ready(function() | |
{ | |
// Hover function which gives different javascript to older IE | |
$("table.inv-table .inv-link").hover(function(){ |