Hello,
thank you all for your replies and the very useful criticisim, I have change some points already...
but I don't get the second point from Rahya?!
Why do you want to change the visibility of the printversion for the login-infos?
I think it is very useful to hide this in the printversion of the page.
@ Eki
I changed some code for the printversion and the read more link in modules/wysiwyg/view.php
WebsiteBaker looks now if a block with an additional text exists in the next position. And if yes, it displays the "read more..." link and jumps to the right position.
If you want to see a live demo visit
http://nifbe.de/pages/aktuelles.php and have a look to the " mehr..." link.
The following code represents my view.php:
<?php
// $Id: view.php 399 2006-12-24 07:50:44Z Ruebenwurzel $
/*
WebsiteBaker Project <http://www.WebsiteBaker.org/>
Copyright (C) 2004-2007, Ryan Djurovich
WebsiteBaker is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
WebsiteBaker is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with WebsiteBaker; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// How many wysiwyg sections exists
if(!isset($count_sections)){ // do it once
$query = "SELECT COUNT(".TABLE_PREFIX."mod_wysiwyg.section_id) as count_sections
FROM ".TABLE_PREFIX."mod_wysiwyg
LEFT JOIN sections ON ".TABLE_PREFIX."mod_wysiwyg.section_id = ".TABLE_PREFIX."sections.section_id
WHERE ".TABLE_PREFIX."mod_wysiwyg.page_id = ".PAGE_ID." AND block = 1";
$get_content = $database->query($query);
$fetch_content = $get_content->fetchRow();
$count_sections = $fetch_content['count_sections'];
}
// Get content
$get_content = $database->query("
SELECT content, position FROM ".TABLE_PREFIX."mod_wysiwyg
LEFT JOIN sections ON ".TABLE_PREFIX."mod_wysiwyg.section_id = ".TABLE_PREFIX."sections.section_id
WHERE ".TABLE_PREFIX."mod_wysiwyg.section_id = '$section_id'");
$fetch_content = $get_content->fetchRow();
$content = ($fetch_content['content']);
$position = $fetch_content['position'];
$nextposition = $position+1;
$query = "
SELECT content FROM ".TABLE_PREFIX."mod_wysiwyg
LEFT JOIN sections ON ".TABLE_PREFIX."mod_wysiwyg.section_id = ".TABLE_PREFIX."sections.section_id
WHERE 1
AND ".TABLE_PREFIX."sections.block = 2
AND ".TABLE_PREFIX."sections.position = ".$nextposition."
AND ".TABLE_PREFIX."sections.page_id = ".PAGE_ID;
$get_content = $database->query($query);
$fetch_content = $get_content->fetchRow();
$content2 = ($fetch_content['content']);
$wb->preprocess($content);
if($content2){
if($_GET["content"] == 2 && $_GET["s"] == $section_id){
echo $content; // return the content
echo '<a name="s'.$section_id.'"></a>';
$wb->preprocess($content2);
echo $content2; // return the detailed Version
}else{
$read_more_link = ' <a href="'.$_SERVER['PHP_SELF'].'?content=2&s='.$section_id.'#s'.$section_id.'"> mehr...</a>';
$content = trim($content);
if(substr($content,-4) == "</p>" || substr($content,-4) == "</P>"){
$content = substr($content,0,-4); // cut of the last </p>
$content .= $read_more_link.'</p>'; // add the read more link and the end of the paragraph
}else{
$content = $content.$read_more_link; // add only the read more link.
}
if(($_GET["print"] == 1 && $_GET["s"] == $section_id) || !isset($_GET["print"])){
echo $content; // return the content
}
}
}else{
if(($_GET["print"] == 1 && $_GET["s"] == $section_id) || !isset($_GET["print"])){
echo $content; // return the content
}
}
if(!isset($_GET["print"])){
echo '<div class="printerlink"><a href="'.$_SERVER['PHP_SELF'].'?content=2&s='.$section_id.'&print=1" target="_blank" title="Diesen Artikel drucken"><img src="'.TEMPLATE_DIR.'/images/NIFBE_Drucker.jpg" alt="Druckersymbol" align="right" /> Druckversion </a></div>';
}
if($section_index < $count_sections){
echo "<hr />";
}
?>
But if you want to use it, make sure that you activate the necessary options in your info.php and the WebsiteBaker configuration to use more than one block.