I use this to overcome the unreliable HTTP_REFERER:

//  In top of layout 
<?php if(!isset($_SESSION)) { session_start(); }  ?>

// In bottom of layout
<?php if( !isset($_SESSION['previous-page']) ){$_SESSION['previous-page'] = htmlentities($_SERVER['REQUEST_URI']);}?>

Then session 'previous-page' hold the previous page a visitor came from.
Maybe not perfect but it works for me.

This might be just slightly better:

<?php $_SESSION['previous-page'] = htmlentities($this->url()); ?>

52

(6 replies, posted in General)

The only thing I can say is that it works fine on Chromium.

53

(11 replies, posted in General)

I use the Firefox plugin Ghostery, it protects me against most common trackers.

54

(14 replies, posted in General)

don wrote:
Fortron wrote:

I use WS_FTP Pro on Windows and Filezilla on Lubuntu.
It there any other good FTP client for Linux, pehaps more secure?

I like cyberduck because it has everything you need and uses sftp and you can drag and drop.
see link here

But it seems Cyberduck is only available for Mac OS X.

55

(14 replies, posted in General)

I use WS_FTP Pro on Windows and Filezilla on Lubuntu.
It there any other good FTP client for Linux, pehaps more secure?

56

(7 replies, posted in Security Announcements)

mvdkleijn wrote:

However, starting with release of 080, versioning and development strategy will change drastically. So in that case it won't be necessary anymore. (we'll use a "php standardized" version string)

That sounds good, it will make it easier for everyone including developpers.

57

(9 replies, posted in General)

mm wrote:

Wow, I've been out for a moment and my code snippet has grown into a plugin smile. Thanks Fortron for encapsulating it!

Well it can obviously be improved.
It would be nice to allow users to add ip's thrue the plugin backend settings.
Perhaps i'll add it.

58

(9 replies, posted in General)

don wrote:

So where exactly should I put it ??

Download it here

Unpack the file, edit index.php and add your ipaddress to the allowedIp array and save it.
Next upload the unpacked folder to the Wolf CMS plugins directory and enable it in the backend.
That should do it.

59

(9 replies, posted in General)

Great idea, just tested it and it works fine.
Why not make it a plugin and add it to the repository?


I did change thought since my admin dir is named differently:

if (startsWith($uri, '/' . ADMIN_DIR)) {  

60

(7 replies, posted in Security Announcements)

Perhaps its usefull to introduce a SP_VERSION for cases like this?

61

(7 replies, posted in Security Announcements)

Thanks for the fixes.

After the updates some (thirdparty) plugins print this message:
"This plugin CANNOT be enabled! It requires Wolf version 0.7.5."

To name some plugins:
Visitors
Roles Manager
Funcky Cache
Messages

For now I just changed CMS_VERSION back to its previous value.

Certainly like the idea of such control, thumbs up i'll say.

63

(2 replies, posted in General)

mvdkleijn wrote:

I haven't tested Wolf CMS against PostreSQL 9. However, there is a rogue mysql_escape_string() call in the save function for the archive plugin's settings page so that might explain it?

Does the same setup work with a different DB?

Not sure if the save function plays a role, I haven't saved any pages yet.
The same setup works fine with MySQL and SQLite.

Just to be clear, the stuff inside the red square is not displayed when using PostreSQL 9:
screen 1

screen 2

The listing of the articles on the Articles page works fine though,
same for the Recent Entries on the homepage.

64

(2 replies, posted in General)

Is there any known issues with the archive plugin in combination with postgresql 9.1?
It does not display any of the archived children links on the the frontend.

65

(4 replies, posted in General)

I use this on a website, perhaps it also usefull for your situation:

<?php $last_articles = $this->children(array('order' => 'id DESC')); ?>
<ul>
<?php foreach ($last_articles as $article): ?>
<?php
$limit = CHAR_LIMIT;
$str = $article->title;
if (strlen($str) > $limit);
$str = substr($str,0,$limit);
?>
<li><?php echo $article->link($str); ?></li>
<?php endforeach; ?>
</ul>

In my case I added CHAR_LIMIT to config.php since all sidebars need to use it:

// used to set a limit on the chars displayed in sidebar links
define('CHAR_LIMIT', 32);

66

(2 replies, posted in General)

I think you mean like a teaser?
http://www.wolfcms.org/wiki/howto:displ … -more_link

67

(12 replies, posted in General)

Try this, but it might need the slashes ("/fitness-wellbeing-news/") though:

<?php
function mycssclass($page_slug){
    switch ($page_slug) :
        case  "fitness-wellbeing-news": return '<div class="br6" id="m-header">'; 
        case  "energetix-news": return '<div class="br5" id="m-header">';
        default: return '<div class="br4" id="m-header">';
    endswitch;
}

echo mycssclass($article->parent()->slug());
?>

I do think it would be cleaner when just using the page id's.

68

(12 replies, posted in General)

Change the number after each case to the correct page id.
Again untested so it might not even work:

<?php
function mycssclass($page_id){
    switch ($page_id) :
        case  0: return '<br6>'; 
        case  1: return '<br5>';
        default: return '<br4>';
    endswitch;
}

echo mycssclass($article->parent()->id());
?>

69

(12 replies, posted in General)

Hilton wrote:

Few questions on customising this:

1) What code do I use to echo the slug of the parent page? Currently I'm using

<?php echo $article->slug; ?>

Have not tested it but I think this should do it:

<?php echo $article->parent()->slug() ?>;
Hilton wrote:

3) What code to display the date of the article without the day of the week or the year (i.e. just 06 Apr)

See this page for the date function:
http://www.wolfcms.org/wiki/functions:date

70

(12 replies, posted in General)

Hilton wrote:
<?php $articles = adv_find(
    array('/news/miessence-news/', '/news/energetix-news/', '/news/fitness-wellbeing-news/'),
    array('order' => 'published_on DESC', 'limit' => '10')); ?> 

Any idea why this is blank?

Is there anything in $articles?

<?php print_r($articles); ?>

71

(10 replies, posted in General)

I can only speak for myself:
I'm nuts about Wolf CMS, yes sir.
Not sure of that answers your question, but at least you know now of one nutter.

72

(18 replies, posted in General)

To prevent double slashes in url's I use this right after Rewritebase in .htaccess:

  # prevent double slashes in the url
  RewriteCond %{THE_REQUEST} ^[A-Z]+\ /(([^/\ ]+/)*)/+([^\ ]*)
  RewriteRule ^ /%1%3 [L,R=301]

Perhaps its usefull to someone.

73

(2 replies, posted in Menu development)

David wrote:

In the code on the wiki page, what happens if you comment out the 5th line of the second code block (that produces the "actual" menu?) - it starts:

echo '<li>'.$page->link($page->title, ....

You would have an extra UL set, but maybe that's OK. Does that work? hmm

Thanks a lot David it works offcourse.
Cant believe I did not spot that obvious solution myself big_smile

I use the unlimited children code:
http://www.wolfcms.org/wiki/navbook:unlimited

But how do I remove the home link from the list?

75

(3 replies, posted in General)

Its allways nice to have another admin theme.
I like what you did so i'm using it on a website.