Browsing Category: "PHP"

Tiled backgrounds designer

PHP September 17th, 2008

Tiled backgrounds designer

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Will Orkut be closed in Brazil?

PHP August 26th, 2008

Orkut one of the worlds biggest social networking sites can have it’s operations shut down back in Brazil. This was one of the major headlines of Brazil’s biggest newspapers and technology related blogs back in April 2008.

According to the issue was related to the number of kidnaps, sex-predators, drug dealers,  and  pedophiles. The article says that whole issue is that Orkut Management is obstructing the act of justice when it denies to give the user information to the Police. The article also says that Orkut Management will give these information if a judicial order is presented. Well this is the whole mess and it seens not be over yet.

After that  some changes have happened in Brazil with Orkut. Acording to another newspaper, Google would have moved all Orkut Management back to Brazil (August 2008) and some drug dealers that used Orkut as a business area, where arrested (Jully 2008).

Why this is so big of happening? Well Brazil holds almost 54% of Orkut users (source: Wikipedia) and almost 26% of all Orkut traffic come from Brazil. Shutting down Orkut in Brazil can mean shutting down Orkut worldwide. If I think it is going to happen? No, but there is more of this battle to came and as soon as I get an update I will post it here.

So, do you think Google will shut down Orkut operations in Brazil?

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

andPHP.com - The Faster Way To Learning PHP

PHP August 26th, 2008

PHPImage via Wikipedia andphp.JPG PHP blog from a group of Orlando developers.

andPHP.com - The Faster Way To Learning PHP

Reblog this post [with Zemanta]

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Smart Image Resizer (PHP): a simple way to create thumbnails and more on the fly — Shifting Pixel

PHP August 26th, 2008

image_resizer.JPG

Smart Image Resizer resizes images on the fly and caches the result.

Smart Image Resizer (PHP): a simple way to create thumbnails and more on the fly — Shifting Pixel

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Zend PHP5 Self Test

Zend, Zend Certification, PHP July 10th, 2008

I was looking for ways to practice for Zend PHP5 Certification test when I came by this blog. There are some questions with answers and you can definitely measure your level with this.

Check it out: Zend Certification Self Test

Alright, more stuff was found and I have actually found another blog with some very good examples, real ones, of how the certification work and what you should expect.

Preparing for the Zend Certification

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Creating a template for Joomla 1.5

Joomla, Great Ideas, graphic design, Web Development, FireFox, PHP July 2nd, 2008

There is not too much secret to create a template for Joomla 1.5. The concept is the same as breaking a design for any site and you just need to know some content anchors and some “must have” files to make it work.

Let’s start with the “must have files”. No matter what kind of template you are building you will need the following:

  • index.php
  • templateDetails.xml
  • template_thumbnail.png
  • a css folder with template.css (or whatever name you want to use.css) inside
  • a images folder with at least the logo.png file (must have this name)

If you have this, your template is half away to be complete.

The templateDetails.xml is tricky and it have changed from the 1.0.x version to the 1.5.x version. Anyway this file must have the following parameters:

  • xml opening tag: <?xml version=”1.0″ encoding=”utf-8″?>
  • install open with version and type described: <install version=”1.5″ type=”template”>
    • name: this will be the name displayed on joomla for your template, but it will be as well the directory of the template
    • creationDate
    • author
    • copyright
    • authorEmail
    • authorUrl
    • version: the version of the template
    • description: the description that will be shown for the administrator on joomla
    • and files: all the files that you use on your template
      • with filenames (off course has to contain  the “most have” files)

Now all you need to do is break the design and attach the content anchors on your file and this is how it works. When you go the module manager on Joomla you will see a bunch of module positioning availabe. Copy those names, you will need them. They are the current anchors that you have available to use on your template. You can definitly change what module is on which positioning on the module manager, and that can affect the use of your template.

Anyway, for any module positioning on your template, let’s say, left, you will use the following command:

<jdoc:include type=”modules” name=”modulename: left for example” />

You don’t need to write a html header, those Joomla will take care of, but you will need to tell Joomla to do that and for that you will need to use:

<jdoc:include type=”head” />

At the very first line of your index.php you will need to test if you can execute Joomla. It’s required for the template. Anyway, you still have to work out some other checks needed for Joomla to work, so this is how your header must be:

“<?php
defined( ‘_JEXEC’ ) or die( ‘Restricted access’ );
JPlugin::loadLanguage( ‘tpl_SG1′ );
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”<?php echo $this->language; ?>” lang=”<?php echo $this->language; ?>”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; <?php echo _ISO; ?>” />
<?php if ($my->id) { initEditor(); } ?>
<jdoc:include type=”head” />
<link rel=”stylesheet” href=”templates/system/css/system.css” type=”text/css” />
<link rel=”stylesheet” href=”templates/<?php echo $this->template ?>/css/template_css.css” type=”text/css” />
</head>

Now, construct your template how it should be. Add the anchors and for the content area, add the following anchor:

<jdoc:include type=”component” />

You are done. Keep these tips and tricks in mind and you will create a Joomla Template in no time.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Setting PHP INI Settings with .htaccess

Cool Shit, Joomla, Web Development, PHP June 13th, 2008

Sometimes you just don’t have access to the PHP INI and now what?

It’s pretty simple, just use the .htaccess file to set the PHP.INI setting that you need.

For instance setting down Register Globals you would use:

php_flag register_globals off

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Running PHP5 scripts without changing the file extension

PHP June 11th, 2008

Consider this scenario:

You are on a shared server than runs PHP4 and 5 as CGI simultaneasly and the server understands files ending with .php as PHP4 and .php5 as PHP5 engine files.

How to make your website run with PHP5 without changing the extension. It’s simple:

Create a .htaccess file and use one of the following:

  •  AddType x-mapp-php5 .php
  • AddHandler application/x-httpd-php5 .php
  • AddHandler cgi-php5 .php

Note: The second one works very well with Verio servers.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

emalloc - Memory allocation issue with Joomla.

PHP June 3rd, 2008

I was trying to install a very large file (6MB) as a template on Joomla and even after I have changed the PHP.INI settings, I could not do the install.

After a lot of research I have found one forum post  that gave part of the idea of what’s happening, but did not gave-me an idea how to fix it.

Everytime that the file was being uploaded, I have checked the error log and I got the following error:

FATAL: emalloc(): Unable to allocate 11918129 bytes

What was happening was that the site account was under a shared hosting account and the PHP.INI settings of the site was getting in conflit with the shared hosting PHP.INI settings (this is at least the best guess). Anyway, the file was not being uploaded and I could not install the template.

Here’s how we did trick the system to fix it.

If we could not allocate x amout of bytes of memory because the file was too large, make it smaller. I changed all the images to 1kb file size. The image folder was the biggest one. After that I have re-uploaded the file and it was 100% sucessfull.

After the sucessfull install, I have accessed the website by FTP and replaced the files with the correct ones.

If you are getting this error, or is getting an error like: Unable to upload file from the extension manager on Joomla 1.53, this trick might help you.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Apache PHP MySQL and Runaway Scripts | MySQL Performance Blog

PHP May 21st, 2008

Apache PHP MySQL and Runaway Scripts | MySQL Performance Blog
The STOP button discovery (and so script abortion) worked only in case script was outputing something. If script is just doing something like scripts or MySQL calls and does not output anything to the browser neither automatic termination not connection_aborted() check seems to work. More over you need both ob_flush() and flush() together with IO for it to work reliably as if no low level network send is attempted connection abort from client will not be discovered.
This is unfortunately very serious limitation in practice when you’re using MySQL with PHP as you can have single runaway query which takes a lot of time and which does not allow you to do any output (to see if user is still waiting) while it happens.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
blank