Senin, 13 Februari 2012

.htaccess tricks to speed up

Paste all this code into .htaccess file for Apache Based Web Servers. :)


<IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On
  RewriteBase /
#
#  Full path to your site
#
RewriteBase /
# Rename Photo Names
# RewriteRule ^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)\-(.*?)([_0-9]*?)\.(.*)$ file/pic/photo/$1/$2/$3$5.$6
#
#  Rules
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?do=/$1
 
# Image Access Protection
# RewriteRule ^file/pic/photo/(.*)\.(.*)$ static/image.php?file=$1&ext=$2</IfModule>
# Modify Headers<IfModule mod_headers.c>
# Cache files<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$">
  Header set Cache-Control "public"
  Header set Expires "Mon, 20 Apr 2015 20:00:00 GMT"
  Header unset Last-Modified</FilesMatch>
 
# Cache JavaScript & CSS<FilesMatch "\.(js|css)$">
  Header set Cache-Control "public"
  Header set Expires "Mon, 20 Apr 2015 20:00:00 GMT"
  Header unset Last-Modified</FilesMatch>
</IfModule>
 
# BEGIN GZIP<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE  text/html text/css text/plain image/svg+xml text/javascript text/xml application/x-javascript text/js image/jpg application/x-httpd-php application/xhtml+xml application/rss+xml application/javascript application/x-httpd-fastphp application/json</ifmodule>
# END GZIPAddHandler mode-deflate mod_deflate
 
# @todo This may not be effective in some cases
Header unset Pragma
FileETag None
Header unset ETag
 
# BEGIN Cache-Control Headers<ifModule mod_headers.c>
# 1 YEAR<FilesMatch "\.(ico|pdf|flv)$">
Header set Cache-Control "max-age=29030400, public"</FilesMatch>
# 1 YEAR<FilesMatch "\.(css|js|php)$">
Header set Cache-Control "max-age=29030400, proxy-revalidate"</FilesMatch>
# 3 MONTH<FilesMatch "\.(gif|jpg|png|swf)$">
Header set Cache-Control "max-age=7257600, public"</FilesMatch>
# 2 DAYS<FilesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, proxy-revalidate"</FilesMatch>
# 1 MIN<FilesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=60, private, proxy-revalidate"</FilesMatch>
</ifModule>
# END Cache-Control Headers
 
AddHandler application/x-httpd-php .css
 
# Pass the default character set
AddDefaultCharset utf-8

Add A Shout Button To The Shoutbox

This tutorial will show you how to add a button to your shoutbox so that members don't have press enter to shout. Some members if not most don't realize you have to press enter.

Posted Image

Open: /module/shoutbox/template/default/block/display.html.php

Find:

<div><input id="js_shoutbox_input" type="text" name="shoutout" size="20" style="width:73%;" maxlength="255" value="" /></div>

Replace with:
<div><input id="js_shoutbox_input" type="text" name="shoutout" size="20" style="width:73%;" maxlength="255" value="" />  <input id="submitButton" class="button" style="vertical-align:top" size="20" value="{phrase var='shoutbox.shoutbox_button'}" maxlength="25" type="submit" />
</div>

Save and close.

Next: Navigate to acp and create new language phrase for shout button

Posted Image
Save entry and clear cache and view the shout button in action. Enjoy!

Redirect mobile users to the mobile version of your site

dd these codes at very top of your THEMES >>> YOUR DEFAULT THEME >>>EDIT TEMPLATES >>> PAGES >>> INDEX.HTML.PHP


/*****************************/
<?php

$mobile_browser = '0';
$mobile_url = 'url of your mobile site';
if (preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|android)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
        $mobile_browser++;
}
if ((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml') > 0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))) {
        $mobile_browser++;
}  

$mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'], 0, 4));
$mobile_agents = array(
        'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',
        'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',
        'ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-',
        'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-',
        'newt','noki','oper','palm','pana','pant','phil','play','port','prox',
        'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar',
        'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-',
        'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp',
        'wapr','webc','winw','winw','xda ','xda-');
if (in_array($mobile_ua,$mobile_agents)) {
        $mobile_browser++;
}
if (strpos(strtolower($_SERVER['ALL_HTTP']),'OperaMini') > 0) {
        $mobile_browser++;
}
if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'windows') > 0) {
        $mobile_browser = 0;
}
if ($mobile_browser > 0) {
   header("location: $mobile_url");
}
else {
   // Continue loading the PC version.
}  
?>
/*************************************************/

replace 'url of your mobile site' with the URL of your mobile website.

Dont follow to +rep ;)

To to change the URLs of v3 to pretty URLs

HEre's a simple trick on how to change the URL of your phpfox v3 URL from
something like


MySite.com/index.php?do=/blog/  
to

MySite.com//blog/  


1. Change Edit the file ~//include/setting/server.sett.php

2. Change the line :
$_CONF['core.url_rewrite'] = '2';

to

$_CONF['core.url_rewrite'] = '1';

3. Save the file.

4. Make sure that the
 .htaccess
is configured accordingly (otherwise , copy the default
htaccess.txt
to
.htaccess
(not the dot before htaccess ! )

5. Refresh your web page. Better yet, navigate to MySite.com and try to access the sub menus.
If everything was set up correctly , you should be able to visit pages in the format :
MySite.com/blog
,
MySite.com/pages
..etc

Remember to +rep

Integrating Farmville In to Your phpfox 3 Site

 Hey Gang, holler Team here and I'm Pleased To Announce How You Can Integrate Farmville in Your Php-Fox 3 Social Site, Just Follow My LeadPosted Image




1.) make a page for this, go to AdminCP—CMS--Pages--Add New Page Product: phpFox (V3 the product is Core) Module: User Page Title: (name this what you want) In the Options, make sure you have Add to Menu set to Yes.

2.).In the Options, make sure you have Add to Menu set to Yes. In the User Group Access, make sure you have Guest and Banned unchecked as this is an iframe and not good for guests or banned members to access.

3.) Then Copy This Code Into Page Data


<iframe src="http://farmville.com" name="iframename" scrolling="yes" align="left" height = "1500px" width = "995px"> </iframe>

Google Translate

Support for our add ons is in the forum here. http://scripttechs.com/forum/script-techs-add-ons-...

I have two versions of this add on. Version 2 is what you see on Script Techs here at the top of the screen. Version 1 is larger and looks like the image below.
Posted Image

This add on will put a Google site translator in block 6, site-wide. Just download the attached file, unzip it. Open the upload folder and upload the files within the upload folder to the directory on your server where phpFox is installed (usually public_html).

After uploading the files, go into your AdminCP and go to Extensions-->Products--> Import Products. You will see Script Techs GoTranslate. Click to install it.

Clear your cache.

You can place this block wherever you want it by going to Blocks--Manage Blocks and select Site Wide. Find the gotranslate::gotranslate block and click to the left and edit it. You can also select which user groups have access to this in the edit block screen.

You can see it in action at the top of the screen. Posted Image
Tags: google translate, free add ons

Attached Files

Download

Poker (App)

1. Upload and extract in ur phpfox root
2. Now go to www.yourdomain.com/apps
3. Create an App
4. Name Your App, Describe it. (Click Next)
5. Dont click save unless you complete the following (Step 6).
6. Upload your Image, Give url ( http://yourdomain.com/tools/apps/pokerr/

Save Settings

Done !

Download

Tags

Blog Archive