B2evo date error: system's timezone settings
by hybride on Aug.22, 2010, under Code, PHP, Posts, Tutorials
The error:
So it should like this:
warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'aaaaaa' for 'aaaaa' instead in /home/aaaaa/public_html/inc/_core/_misc.funcs.phpThe fix: Put this line of code after you list of dependencies in /home/aaaaa/public_html/inc/_core/_misc.funcs.php
PHP:
date_default_timezone_set('UTC'); |
PHP:
/** | |
* Dependencies | |
*/ | |
load_funcs('antispam/model/_antispam.funcs.php'); | |
load_funcs('files/model/_file.funcs.php'); | |
date_default_timezone_set('UTC'); |
Manual Twitter for B2evolution
by hybride on Aug.18, 2010, under Code, Posts, Tutorials
One of the earlier problems that I had was getting Tweetmeme / Twitter to work for B2evolution - the Tweetmeme for B2evo was great, but it broke every so often (not sure if it was because of Tweetmeme, the skin itself, or B2evolution's code.)
So for those of you who need Twitter to work on B2evo, but can't get it to work, here's a manual hack of the code for your skin. (On that note, if you alternate skins, it would have to be hacked for every skin.)
And that's it. This will show the Twitter twitting twits thing (say that 5x fast) for every post you have, including when you actually open up the pages.
So for those of you who need Twitter to work on B2evo, but can't get it to work, here's a manual hack of the code for your skin. (On that note, if you alternate skins, it would have to be hacked for every skin.)
- Go to the skin that you are using. The location should be something like "/b2blog/skins/skinname/" where "b2blog" is your b2evolution installation location, and "skinname" is the skin that you are using.
- Find the file "index.main.php". Open it up to edit.
- Scroll down to around line 74, where the content says: [codespan] [/codespan]
- Right underneath it, copy and paste your Twitter code.
PHP:
Make sure it's before the div tags, and remember to edit "yoursn" to your Twitter screen name!<script type="text/javascript">tweetmeme_screen_name = 'yoursn';tweetmeme_style = 'compact';</script><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div> <!-- end of id="content" --></div> <!-- end of id="contentwrapper" -->
And that's it. This will show the Twitter twitting twits thing (say that 5x fast) for every post you have, including when you actually open up the pages.
New Product module updated for Prestashop
by hybride on Aug.14, 2010, under Code, PHP, Posts, Tutorials, Prestashop
I'm sorry, but Prestashop's modules can suck sometimes... especially since Smarty is involved. Case in point: new product module. I don't know about you, but why is the module written manually with 4 "li" tags rather than looped? You can have only 4 New Products listed then, manually added (the ids were put in straight into the code...) which completely defeats the purpose of having it dynamically change in the back-end.
Anyway, being frustrated enough, I have rewrote it. The module is located in /modules/blocknewproducts/.
This is the original (or close enough, the code is the same, I removed the 3 other "li" statements, so there is only one):
Remove the entire thing, and paste this bad boy up:
Das it. Compared to the original, you get an even shorter, dynamic loop that CAN be changed easily on the backend, no manual ids! Enjoy!
Anyway, being frustrated enough, I have rewrote it. The module is located in /modules/blocknewproducts/.
This is the original (or close enough, the code is the same, I removed the 3 other "li" statements, so there is only one):
PHP:
<!-- MODULE Block new products --> | |
<div class="blocknewproducts"> | |
<h4><a href="{$base_dir}new-products.php" title="{l s='See all' mod='blocknewproducts'}">{l s='New products' mod='blocknewproducts'}</a></h4> | |
{if $new_products} | |
{foreach from=$new_products item=product name=myLoop} | |
{/foreach} | |
<ul> | |
<li class="li_info"> | |
<a href="{$new_products.0.link}"> | |
<img src="{$img_prod_dir}{$new_products.0.id_image}-medium.jpg" alt="{$new_products.0.legend|escape:htmlall:'UTF-8'}" /> | |
</a> | |
<h5> | |
<a href="{$new_products.0.link}" title="{$new_products.0.name|escape:htmlall:'UTF-8'}">{$new_products.0.name|escape:htmlall:'UTF-8'|truncate:30}</a> | |
</h5> | |
<span class="price-discount">{displayWtPrice p=$new_products.0.price_without_reduction}</span> | |
{if $new_products.0.reduction_percent}<span class="reduction">(-{$new_products.0.reduction_percent}%)</span>{/if} | |
<span class="price">{displayWtPrice p=$new_products.0.price}</span> | |
{if $product.description_short} | |
<span class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"> | |
<a href="{$new_products.0.link}">{$new_products.0.description_short|strip_tags:htmlall:'UTF-8'|truncate:60}</a> | |
<a class="linkview" href="{$new_products.0.link}" title="{$product.name|escape:htmlall:'UTF-8'}"> </a> | |
</span> | |
{/if} | |
</li> | |
</ul> | |
| |
{else} | |
<p>{l s='No new product at this time' mod='blocknewproducts'}</p> | |
{/if} | |
</div> |
PHP:
<!-- MODULE Block new products --> | |
<div class="blocknewproducts"> | |
<h4><a href="{$base_dir}new-products.php" title="{l s='See all' mod='blocknewproducts'}">{l s='New products' mod='blocknewproducts'}</a></h4> | |
| |
{if $new_products} | |
<ul> | |
{foreach from=$new_products item=product name=new} | |
<li class="li_info"> | |
<a href="{$product.link}"><img src="{$img_prod_dir}{$product.id_image}-medium.jpg" alt="{$product.legend|escape:htmlall:'UTF-8'}" title="{$product.name|escape:htmlall:'UTF-8'}"></a> | |
| |
<h5><a href="{$product.link}" title="{$product.name|escape:htmlall:'UTF-8'}">{$product.name|escape:htmlall:'UTF-8'}</a></h5> | |
<span class="price-discount">{displayWtPrice p=$product.price_without_reduction}</span> | |
{if $product.reduction_percent}<span class="reduction">(-{$product.reduction_percent}%)</span>{/if} | |
<span class="price">{displayWtPrice p=$product.price}</span> | |
</li> | |
{/foreach} | |
</ul> | |
{else} | |
<p>{l s='No new product at this time' mod='blocknewproducts'}</p> | |
{/if} | |
</div> | |
<!-- /MODULE Block new products --> |
Ooo, alpha!
by hybride on Aug.14, 2010, under Posts
So apparently b2evolution has an alpha 4 available now - for anyone using previous versions, I totally recommend upgrading your b2evo installation. My plugins actually work now. ~_~









