This file contains hidden or 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
phishing attack | |
What to be done if your website is under phishing attack | |
1) http://www.semanticoverload.com/2009/03/17/if-your-site-has-been-compromised-with-phishing-attack- code/index.html | |
2) http://google-gruyere.appspot.com/ |
This file contains hidden or 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->db->last_query(); | |
Returns the last query that was run (the query string, not the result). Example: | |
$str = $this->db->last_query(); | |
// Produces: SELECT * FROM sometable.... |
This file contains hidden or 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
<!-- featured posts --> | |
<div class="span12"> | |
<?php | |
query_posts('category=featured&showposts=2'); | |
if (have_posts()) : | |
while (have_posts()) : the_post(); | |
?> | |
<div class="span5"> | |
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> | |
<?php |
This file contains hidden or 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
function truncateWords($text, $maxLength = 15) | |
{ | |
// explode the text into an array of words | |
$wordArray = explode(' ', $text); | |
// do we have too many? | |
if( sizeof($wordArray) > $maxLength ) | |
{ | |
// remove the unwanted words | |
$wordArray = array_slice($wordArray, 0, $maxLength); |
This file contains hidden or 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="span3 " id="<?php echo $post->ID; ?>"> | |
<div class="" style="margin-left:0px;"> | |
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> | |
<div class="postimg" id="img_<?php echo $post->ID; ?>"> | |
<?php | |
if(has_post_thumbnail()) { ?> | |
<?php //echo get_the_post_thumbnail($post->ID, array(255,90)); ?> | |
<img src="<?php bloginfo('template_directory'); ?>/wp-content/themes/mytheme1/timthumb.php?src=<?php echo get_image_url(); ?>&h=90&w=255&zc=1" alt="<?php the_title(); ?>"/> | |
<?php } else { | |
echo '<img src="'.get_bloginfo("template_url").'/images/nothumb.jpg" alt="No Thumbnail"/>'; |
This file contains hidden or 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 | |
/** | |
* TimThumb by Ben Gillbanks and Mark Maunder | |
* Based on work done by Tim McDaniels and Darren Hoyt | |
* http://code.google.com/p/timthumb/ | |
* | |
* GNU General Public License, version 2 | |
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html | |
* | |
* Examples and documentation available on the project homepage |
This file contains hidden or 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 | |
$uploadpath = $_SERVER['DOCUMENT_ROOT']."/useruploads"; | |
$allowedExts = array("gif", "jpeg", "jpg", "png"); | |
$extension = end(explode(".", $_FILES["upload"]["name"])); | |
if ((($_FILES["upload"]["type"] == "image/gif") | |
|| ($_FILES["upload"]["type"] == "image/jpeg") | |
|| ($_FILES["upload"]["type"] == "image/jpg") | |
|| ($_FILES["upload"]["type"] == "image/pjpeg") | |
|| ($_FILES["upload"]["type"] == "image/x-png") |
This file contains hidden or 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 | |
$pages = get_pages(); | |
?> | |
<?php $count = 1; ?> | |
<div class="span12"> | |
<?php | |
foreach ( $pages as $page ) { | |
$page_link = get_page_link( $page->ID ); | |
$title = $page->post_title; | |
?> |
This file contains hidden or 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 | |
//Delete file if it exists for more than 3 hrs | |
$path = $_SERVER['DOCUMENT_ROOT']."/delete_test_files"; | |
if ($handle = opendir($path)) { | |
while (false !== ($entry = readdir($handle))) { | |
if ($entry != "." && $entry != ".." && preg_match('/.*.ps/i', $entry)) { | |
$last_modified = filemtime($path .'/' . $entry); | |
$last_modified_str = date("Y-m-d H:i:s", $last_modified); |
This file contains hidden or 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 sendEmail_toolbar() | |
{ | |
JToolBarHelper::custom('sendEmail', 'send.png', 'send.png', 'Send', false, false ); | |
} |