You are not logged in. Please login or register.
Active topics Unanswered topics
Search options (Page 3 of 38)
Wolf CMS Forum » Posts by Fortron
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()); ?>
The only thing I can say is that it works fine on Chromium.
I use the Firefox plugin Ghostery, it protects me against most common trackers.
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.
I use WS_FTP Pro on Windows and Filezilla on Lubuntu.
It there any other good FTP client for Linux, pehaps more secure?
That sounds good, it will make it easier for everyone including developpers.
mm wrote:Wow, I've been out for a moment and my code snippet has grown into a plugin
. 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.
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.
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)) {
Perhaps its usefull to introduce a SP_VERSION for cases like this?
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.
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:


The listing of the articles on the Articles page works fine though,
same for the Recent Entries on the homepage.
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.
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);
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.
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());
?>
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
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); ?>
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.
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.
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? 
Thanks a lot David it works offcourse.
Cant believe I did not spot that obvious solution myself 
I use the unlimited children code:
http://www.wolfcms.org/wiki/navbook:unlimited
But how do I remove the home link from the list?
Its allways nice to have another admin theme.
I like what you did so i'm using it on a website.
Posts found [ 51 to 75 of 948 ]
Wolf CMS Forum » Posts by Fortron