Viewing entries tagged with 'PHP'

The gallery title in a custom NextGEN Gallery template

08 February 2017

Tags: ,

When using custom album and gallery templates, NextGEN Gallery plugin doesn't provide any variables with the gallery name to the gallery template:

 

xdebug shows no title var in ngg custom tpl

0 comments | Read the full post

PHP quirks: a caveat with array string keys and an 'array_shift' call

24 January 2012

Tags: ,

What do you think the following code snippet prints?

// Fill the array (each array element has the same value as a key)
foreach(array('07', '08', '09', '10') as $n){
    $a[$n] = $n;
}

// Delete the first element from the array
array_shift($a);

// Print a value of the element with a key of '10'
echo $a['10'];

If you, like me, think that the element of the array with a key of '10' has a string value of "10", then you're unfortunately wrong. But now you've got a reason to read the article further.

0 comments | Read the full post

How to remove "Your website URL" field from comment forms in Silverstripe CMS

22 September 2011

Tags: , , ,

It's obvious that “Your website URL” field in Silverstripe comment forms is a plum for spammers, so let's remove this field.

0 comments | Read the full post

1 2


Интернет реклама