As published by sitepoint
http://www.sitepoint.com/best-php-framework-2015-sitepoint-survey-results/
This becoming my favorite image gallery now – fotorama.io. So easy to implement with plenty of customization that we can do.
If you don’t believe how easy it is, copy following source code, paste and save as an html file. Then open it and see what will happen.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <link href="http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.3/fotorama.css" rel="stylesheet"> <script src="http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.3/fotorama.js"></script> <div class="fotorama" data-width="100%" data-ratio="800/600" data-nav="thumbs" data-loop="true" data-allowfullscreen="true"> <img src="http://s.fotorama.io/1.jpg"> <img src="http://s.fotorama.io/2.jpg"> </div>
Alternatives:
When people share your page on facebook, you can set what image to be displayed together with your page description on facebook.
The code:
<meta property="og:image" content="http://yourdomain.com/path/to/image.jpg" />
References on FB
1. All result set
$query = $this->db->query("YOUR QUERY");
if ($query->num_rows() > 0)
{
foreach ($query->result() as $row)
{
echo $row->title;
echo $row->name;
echo $row->body;
}
}
2. Just one row
$query = $this->db->query("YOUR QUERY");
if ($query->num_rows() > 0)
{
$row = $query->row();
echo $row->title;
echo $row->name;
echo $row->body;
}
This editor is fast and neat but requires plugins to be installed to fully utilize the power.
1. install the package control
cmd+shift+P package control:install package
2. then install other plugins via the package control using the same step.
Some of the plugins.
Other sources on useful plugins:
http://wasil.org/sublime-text-3-perfect-php-development-set-up
http://neverstopbuilding.com/sublime-plugins-for-php
Getting started with some new tools. To get comfortable with uncomfortables.
Other things to checkout
Why use template library for CI
source: http://jeromejaglale.com/doc/php/codeigniter_template
or alternative download
An object in PHP to manage data
Some sample code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | $dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass); //establish connection $dbh = null; //close connection //insert by prepare statement $stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (?, ?)"); $stmt->bindParam(1, $name); $stmt->bindParam(2, $value); // insert one row $name = 'one'; $value = 1; $stmt->execute(); //get result $stmt = $dbh->prepare("SELECT * FROM REGISTRY where name LIKE ?"); if ($stmt->execute(array("%$_GET[name]%"))) { while ($row = $stmt->fetch()) { print_r($row); } } |
To backup mysql database (all databases) can use this batch file
Then you can compile the .bat file to become .exe file so that the password is hidden.
Download bat to exe converter from CNET download
Lastly, you can include the exe file to run in task scheduler
You can have option to upload the file via FTP to other server
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | :: Start FTP files to remote server :: Create the temporary FTP script file > script.ftp ECHO ftpusername >>script.ftp ECHO ftppassword >>script.ftp ECHO lcd / >>script.ftp ECHO lcd /MySQLBackups/backupfiles >>script.ftp ECHO binary >>script.ftp ECHO prompt n >>script.ftp ECHO put FullBackup.%backupdate%.zip >>script.ftp ECHO bye :: Use the temporary script for unattended FTP :: Note: depending on your OS version you may have to add a '-n' switch FTP -v -s:script.ftp ftphostcom.com :: Overwrite the temporary file before deleting it TYPE NUL >script.ftp DEL script.ftp :: DONE FTP backup file to remote server |
To easily toggle database config for localhost and server, you can simply check whether you are accessing the local or server.
1 2 3 4 5 6 7 8 9 10 11 12 13 | if (preg_match("/localhost/i", $_SERVER['SERVER_NAME'])) { define ('DBHOST','localhost'); define ('DBNAME','localdbname'); define ('DBUSER','localuser'); define ('DBPASS','localpass'); define ('DEV',TRUE); } else { define ('DBHOST','localhost'); define ('DBNAME','serverdbname'); define ('DBUSER','serveruser'); define ('DBPASS','serverpass'); define ('DEV',FALSE); } |