h4x3d.com

- h4x3d.com

Archive
code

I am not discussing whether it should be done or not, but just saying where to do it.
W3 Total Cache is a great plugin and they surely deserve some SEO juice / kudos for their work, but I have seen questions unanswered on the net of people not knowing where to delete pieces of comments that are inserted into their pages. Again, I am not touching the ethics of removing credits, but just offer the tools. Use as liked.

/wp-content/plugins/w3-total-cache/lib/W3/Plugin/TotalCache.php

and uncomment/change as desired.

from

/wp-content/plugins/w3-total-cache/w3-total-cache.php

you can find the lead (the references to the above mentioned file).
find the lines using the search for the html comment…

Read More

As regular visitors may have noticed there were only few (or no) updates to the site in the past few weeks (or months).
This was primarily due to the fact that most of my time was soaked up with finishing my diploma thesis.
I have now successfully graduated from university and will be entering “business” in October this year.
In the meantime I plan to simplify this site and update most of the 700 posts.
My advertisement revenue is down from previous 900 $ USD to a laughable 11 $ USD a month, while the number of visitors has just slightly declined from 10,500 (daily) to 5,000 (okay that’s a 50% drop, but still). The drop in ad revenue is also explained with the new theme that I introduced in December 2009. It is, as I may have to admit, too confusing and too colourful/image heavy.
Many preferred the white theme before (2007 to 2009). In that sense I will try to do a good job in coming up with a real simple and user-friendly design. After all this site is not primarily for me, but for you. Also, I need to fix the download links and generally links that link-out. I will pay more attention to comments. For all the trouble and lack of updates I am sorry. Stay posted and keep the comments coming.

Read More

Today I wanted to publish a real quick post about how to embed a paypal button into your wordpress post. A topic that has been covered many times elsewhere (if you consult google), but yet many paypal buttons failed to hide the merchant’s email address which would result in evil spam to be sent. Anyhow, I thought posting this quick article would take max 5 minutes or so, but it turned out to be more difficult: WordPress MU for security purposes does not allow specific HTML code to be included in posts or pages.
This is for security reasons, as mentioned before, because in a multi-blog environment people could post all sorts of crap to compromise your site, server and work, ultimately driving you nuts and causing all sorts of havoc.

After some Googling I found several interesting articles, most of them repeated themselves and said “well.. edit the ksas.php file in wp-includes” and then stated a long-list with many interesting HTML pieces. This works, but a plugin is more fancy I thought: so I googled on and found a plugin called “unfiltered” content WordPress MU, released by the WordPress guys. This is in so far cool, as you can either stick it in the mu-plugins folder and have it sidewide, or in the regular plugins folder and just activate it on a blog by blog basis. Since I am running this WordPress MU installation on my own and do not have posts to monitor for “havoc causing script includes”, I decided to go for the plugin and enable it side-wide. This way I can upgrade my wordpress mu next time a new version comes out and keep my sanity (because by then I would probably have forgotten about the includes folder and the php file that I need to update every time…)

Hope this helps,
best,
jez

Read More

update: f§*king wordpress mu won’t let me enter tags in my posts. I have tried the wordpress RAW plugin and other filters, but still. more updates on this tomorrow -> solution

There are different approaches to doing this (adding a paypal button to your wordpress page, or any html or php website):

You can copy&paste the code you find on most pages and wonder why you get really a lot of spam emails
or you can use the “secure merchant id” code from paypal
or you can grab a plugin at wordpress.org

To explain the first (revealing code)

<form name=”_xclick” action=”https://www.paypal.com/cgi-bin/webscr” method=”post”>
<input type=”hidden” name=”cmd” value=”_xclick”/>
<input type=”hidden” name=”business” value=”user@spam-me-please.com”/>
<input type=”hidden” name=”item_name” value=”Customer Service”/>
<input type=”hidden” name=”currency_code” value=”USD”/>
<input type=”hidden” name=”amount” value=”1.00″/>
<input type=”image” src=”http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif” border=”0″ name=”submit” alt=”Make payments with PayPal - it’s fast, free and secure!”/>
</form>

While this has its advantages: you can easily specify the parameters, it also has the problem that your email address is very likely to be scraped and spammed by bots. So next time you receive one of those fake paypal “you need to click here to reactivate your account” emails… guess why you are receiving it.

I use the second version, the paypal secured id, because I am not too keen to exposing (any) email address to spam bots. The code below will generate a paypal button with my id in it. To change that or to get your code you need to login to paypal and get it from the merchant tab. Or you can enter “paypal button” in the search field top right of the page.

2) Click on Merchant services.
3) Click on websites payment standards.
4) Click on accept contributions.
5) Click on get donation button.

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="hosted_button_id" value="10155388"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" style="width: 100px; float: right;" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
</form>

And now to the fun part actually: you will not be able to copy and paste the code(s) mentioned above, because wordpress will strip the input fields and nothing will display. So unless you are putting this code into your template (e.g. by including it in a separate php file), it won’t work, I believe.

You can however grab a wordpress plugin, like this paypal plugin to help you out.

Also of help – this support post at wordpress

hope this helps anyone,
best,
jez

Read More

first of all, get rid of the following two things in the header.php:



window.onload = function() {
new SmoothScroll({duration:2000});
}

because if you use lightbox (with prototype it does not play along that well.)
if you want to use lightbox with moo,
you should use slimbox

the file (feather.zip) comes with different headers:
one for slimbox and moo.tools (smallest) default install
one for lightbox (no moo.tools) bigger

also, see the manual.

Read More

Uploading and Installing Coppermine is really is a time-consuming task – not if you can use subversion from the box and simply type:

svn co https://coppermine.svn.sourceforge.net/svnroot/coppermine coppermine

but just to be better safe than sorry I’d go for

svn co https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.4.x/ coppermine

because this is the version that is currently being worked and developed on.
As by the day of writing this, the most recent security release (patch) is only 3 days old- so there is work in progress.

I was not able (yet) to find out the real difference between coppermine 1.4 and 1.5 (or coppermine 1.4.x and 1.5.x) – usually higher numbers are better- right?

somehow though, it seems like the coppermine 1.4.x version is the only actively maintained and supported one (generally speaking in terms of themes and plugins and other fancy gadgets such as bridges to WordPress etc).

If you know anything new, please leave a comment!

svn coppermine install

Read More

I always laugh at sites that have “old” copyright information on them and I almost forgot to update mine.
No-longer shall I be doing that with thanks to PHP´s little helper in form of the following one-line (I call it) “New Year Update Copyright script” in PHP:

What it does is quite obvious: it outputs the current year, so for instance you could have it say:
(c) 2006 – (php block here)

this would render (c) 2006 – 2008

- hope this helps anyone.
Now as I look at this issue, I wonder if I was smart enough to build that into all my themes. If not, I got some revising to do after I have finished my next exam in January (11th).

Update: bleh I put

in pretty much all my themes, which is stupid I fear – but for now it is noted on my to-do list and will be sorted out with the next wave of updates!

Update: Lorelle put the_time(); too, so I guess I might as well leave it like that.

Read More

Do you know the following situation- You are downloading thousands of (small) files from your ftp (server) and it is annoyingly slow and time consuming… If you have shell access to your server, e.g. you can use Putty, logon and cd to your file directory (often httpdocs or www) and execute the following code:

tar -pczf fatfile.tar.gz *

This will create a tar.hz archive with the name of fatfile.tar.gz
It will include all files of the current directory and all sub-directories.

Now you can easily download this file instead of many small files (as experienced before).
If you don’t have shell access (look- even Dreamhost offers this feature for $6,95/month),
you might consider getting your own Virtual Private Server as I did.

Read More

Ever wondered how you could transfer any searches from ?s=TERM to /search/TERM , then read below or visit Alex King’s approach.

This is too good to not report on, so for personal archiving reasons, I have put Alex’ Code below:

Read More

Hi, one of the people commenting here asked for a way of displaying code in one of my themes.
For ages I have been using the following code and it worked flawless in connection with the code markup plugin for wordpress:


.primary pre#hack {
		white-space: pre-wrap;		/* css-3 */
		white-space: -moz-pre-wrap !important;		/* Mozilla, since 1999 */
		white-space: -pre-wrap;		/* Opera 4-6 */
		white-space: -o-pre-wrap;	/* Opera 7 */
		word-wrap: break-word;		/* Internet Explorer 5.5+ */
}

.primary pre {
  overflow: auto;
  cursor:pointer;
  position:relative;
}

.primary pre code {
  display: block;
  margin:10px;
  padding:4px;
  border:1px solid #ddd;
  background:#F5F5F5;
  font:10px Lucida Sans Typewriter, Courier, monospace;
}
.primary can be changed to what you need, e.g. .post or .entry

Usage within WordPress
Simply go to the “code” editor of WordPress and paste your code.
Surround it by a

 and  tag and add the id of "hack" to the
.
(
 stuff here  
Read More