Posts Tagged ‘PHP’
Friday, May 30th, 2008
Just found out about Get Satisfaction’s brand new Help Center and tried to install it? No doubt you’ll run into a few bugs along the way. However, follow this guide and you should be fine.
- Install Smarty into an include directory
-
- This is most easily done by extracting the
lib/ directory from the Smarty package into a new directory called includes/
- Rename the
lib/ directory to smarty/
- Add the following line to your Help Center’s config file:
set_include_path(get_include_path() . PATH_SEPARATOR . '/path/to/includes/');
- Install the HTTP_Request PEAR library
- Install this like any other PEAR library. If you don’t have PEAR, download the archive and extract the
HTTP_Request-* into the previously created includes directory. Then rename the HTTP_Request-* to HTTP
- Setup the database
-
- Create a database called “sprinkles”
- Import the schema from the included SQL file, sprinkles-schema.sql
- Create a folder for compiled templates
- Create the
templates_c/ directory in the Help Center directory to hold the compiled templates for Smarty and make sure it is writable.
- Edit your config
- Edit config.php in your Help Center installation and add the following, replacing “root” and “password” with your respective database username and password:
$mysql_username = 'root';
$mysql_password = 'password';
- Run the web installer
- Head to your installation of Help Center in your browser and the web installer will kick in.
Hopefully this process becomes easier in the future. I would recommend to the Get Satisfaction developers to include HTTP_Request and Smarty with the Help Center package.
Tags: get satisfaction, help center, help centre, http_request, installation, PHP, smarty
Posted in Code Monkey | 4 Comments »
Monday, April 7th, 2008
As a tip to everyone who uses WordPress 2.5 and needs to input their FTP details every time, you can force WordPress to remember them by adding this to your wp-config.php:
define('FTP_HOST', 'ftp://example.com/');
define('FTP_USER', 'example_user');
define('FTP_PASS', 'example_pass');
//Set to true if your host uses SSL connections
define('FTP_SSL', false);
This can be reduced to just your password, if your database already remembers the other details.
Tags: ftp, PHP, wordpress, wp-config
Posted in WordPress Tips | 2 Comments »
Sunday, January 20th, 2008
I just love how 37signals’ Getting Real book appears to be run by PHP. Straight from the headers: X-Powered-By: PHP/5.2.4 - Still, good that they’re fairly up to date 
Tags: 37signals, headers, PHP, ruby
Posted in Asides | No Comments »
Friday, January 4th, 2008
My code is now in WordPress trunk and bbPress trunk. Sweet.
Tags: patching, PHP, wordpress
Posted in Asides | No Comments »
Monday, December 31st, 2007
create_function() — How to create anonymous/one-use functions. I didn’t think PHP had such a way until I looked up preg_replace_callback(). Thanks WordPress!
Tags: anonymous functions, PHP, php manual, wordpress
Posted in Asides | No Comments »
Sunday, December 30th, 2007
As a developer of an aggregator, I test against different types of exploits that users may experience. Up until now, I’ve been adding singular feeds by themselves. However, it’s always irritated me that there was never an OPML file to import them all at once.
Et viola. I wrote myself a simple PHP program to convert a list of URLs into an OPML file (the code’s free for any use, should you find a use for it) and used a list of URLs I had obtained by doing mass copies from the directory pages.
Enjoy
(As a side note, there are 3325 different test feeds.)
Tags: aggregator, Code Monkey, feedparser, Lilina, opml, PHP
Posted in Code Monkey | No Comments »
Sunday, December 23rd, 2007
Note to self: Take a look at this site’s notes about aggregator design for future Lilina styles. Question for the author (if they read this): what exactly did you have to hack internally?
Tags: aggregator, design, Lilina, PHP
Posted in Asides, Lilina | No Comments »
Tuesday, December 11th, 2007
The WordPress Codex site’s MediaWiki installation is currently on 1.4.8. I was listening to some discussion on the wp-hackers list, so I thought I’d present my guide to upgrading. I must warn you first though, I personally use DokuWiki when I need a wiki, as it’s simpler. Without further adieu…
- Extract everything in mediawiki-1.11.0/ into your current MediaWiki folder (i.e. replace the files)
- Delete the following files:
- .cvsignore
- Version.php
- irc/
- docs/deferred.doc
- docs/design.doc
- docs/globals.doc
- docs/hooks.doc
- docs/language.doc
- docs/linkcache.doc
- docs/memcached.doc
- docs/schema.doc
- docs/skin.doc
- docs/title.doc
- docs/user.doc
- docs/html/.cvsignore
- images/.cvsignore
- includes/BlockCache.php
- includes/CacheManager.php
- includes/DatabasePostgreSQL.php
- includes/FulltextStoplist.php
- includes/Group.php
- includes/Image.php
- includes/Interwiki.php
- includes/killthread.php
- includes/MessageCacheHints.php
- includes/ParserXML.php
- includes/Profiling.php
- includes/SearchMySQL3.php
- includes/SiteStatsUpdate.php
- includes/SkinPHPTal.php
- includes/SpecialAsksql.php
- includes/SpecialDebug.php
- includes/SpecialGeo.php
- includes/SpecialListadmins.php
- includes/SpecialMaintenance.php
- includes/SpecialMakesysop.php
- includes/SpecialSitesettings.php
- includes/SpecialUserlevels.php
- includes/SpecialValidate.php
- includes/UpdateClasses.php
- includes/normal/.cvsignore
- languages/Language*.php
- maintenance/build-intl-wiki.sql
- maintenance/changeuser.sql
- maintenance/checktrans.php
- maintenance/cleanupDupes.php
- maintenance/compressOld.inc
- maintenance/compressOld.php
- maintenance/database.sql
- maintenance/DiffLanguage.php
- maintenance/dumpMessages.php
- maintenance/dumpRev.php
- maintenance/importPhase2.php
- maintenance/InitialiseMessages.inc
- maintenance/liveCmdLine.inc
- maintenance/rebuildMessages.php
- maintenance/recount.sql
- maintenance/redundanttrans.php
- maintenance/remove-brokenlinks.php
- maintenance/trivialCmdLine.php
- maintenance/postgresql/
- maintenance/archives/convertdb.php
- maintenance/archives/moveCustomMessages.inc
- maintenance/archives/moveCustomMessages.php
- maintenance/archives/patch-curid-covering.sql
- maintenance/archives/patch-list.txt
- maintenance/archives/patch-rename-user_rights.sql
- math/.cvsignore
- skins/amethyst/
- skins/wikimania/
- skins/common/common.css
- skins/common/images/favicon.ico
- skins/common/images/fileicon-mid.png
- skins/common/images/fileicon-ogg.png
- skins/common/images/fileicon-ogg.xcf
- skins/common/images/fileicon.png
- skins/common/images/magnify-clip.png.old
- skins/common/images/redirect.png
- skins/common/images/valid-html401.png
- skins/disabled/Amethyst.php
- skins/disabled/Amethyst.pt
- skins/disabled/Chick.php
- skins/disabled/Chick.pt
- skins/disabled/MonoBook.pt
- skins/disabled/MonoBookTal.php
- skins/disabled/Wikimania.php
- skins/disabled/WikimediaWiki.php
- skins/disabled/WikimediaWiki.pt
- tests/.cvsignore
- tests/RunTests.php
- tests/SearchMySQL3Test.php
- Rename LocalSettings.php to LocalSettings.old.php (Important: maintenance/upgrade.php will not work)
- Run the installer again, with the same options as before
- Delete config/LocalSettings.php
- Rename LocalSettings.old.php back to LocalSettings.php
- Done!
Tags: dokuwiki, mediawiki, PHP, upgrade, winmerge, wordpress, wp-hackers
Posted in Code Monkey | 1 Comment »
Saturday, May 5th, 2007
I have recently been using a 404 notifier plugin, however the links to mark a comment as spam don’t work. So, I resorted to doing it the PHP and Apache way.
All the spam was coming from bots trying to access a YaBB script. This was located (or so they thought) at /cgi-bin/yabb2/YaBB.pl
I decided that I’d use some htaccess and some PHP. So here it is:
The .htaccess
RewriteEngine On
RewriteRule ^cgi-bin/yabb2/YaBB.pl$ /damnthatyabb.php [L,NC]
The PHP
<?php
if ($_GET['msg']) {
echo 'Thanks for posting, spammer.';
}
else {
echo '<form action="/cgi-bin/yabb2/YaBB.pl" method="GET"> <textarea name="msg"></textarea><input type="submit" /></form>';
}
What it does
It basically takes their input and does nothing with it, but gives them a sense of achievement. We don’t want to disappoint our guests now, do we?
Tags: htaccess, PHP, Spam, yabb
Posted in Code Monkey | 2 Comments »
Monday, January 15th, 2007
Anyone out in these here tubes that knows what the Firefox Add-ons Site is powered by?
If not, anyone know a contact email for someone at Mozilla that might have knowledge on this?
And I wonder if anyone over there has noticed that the developers login, link from the bottom of the page still has the old UI?
Tags: addons, firefox, mozilla, PHP, site backend
Posted in Asides | 7 Comments »