General Community > WebsiteBaker Website Showcase

new German website for a project which supports the development of babies

<< < (2/2)

Eki:
Looks great...To my feeling the color-scheme fits the subject. The layout is clean and understandable in 10 secs. Especially like the way the "read more" link works. Any interest in sharing the code with the community?

regards,
Erik

chio:
Green seems to be a big trend in 2008 ;-)

Very good job, very professional.

spawnferkel:

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:



--- Code: ---<?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[&#39;count_sections&#39;];
}

// 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 = &#39;$section_id&#39;");
$fetch_content = $get_content->fetchRow();
$content = ($fetch_content[&#39;content&#39;]);
$position = $fetch_content[&#39;position&#39;];
$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[&#39;content&#39;]);


$wb->preprocess($content);


if($content2){
    if($_GET["content"] == 2 && $_GET["s"] == $section_id){    
        echo $content;  // return the content
        echo &#39;<a name="s&#39;.$section_id.&#39;"></a>&#39;;
        $wb->preprocess($content2); 
        echo $content2;  // return the detailed Version
    }else{
        $read_more_link = &#39; <a href="&#39;.$_SERVER[&#39;PHP_SELF&#39;].&#39;?content=2&amp;s=&#39;.$section_id.&#39;#s&#39;.$section_id.&#39;"> mehr...</a>&#39;;
        $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.&#39;</p>&#39;; // 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 &#39;<div class="printerlink"><a href="&#39;.$_SERVER[&#39;PHP_SELF&#39;].&#39;?content=2&amp;s=&#39;.$section_id.&#39;&amp;print=1" target="_blank" title="Diesen Artikel drucken"><img src="&#39;.TEMPLATE_DIR.&#39;/images/NIFBE_Drucker.jpg" alt="Druckersymbol" align="right" />&nbsp;Druckversion&nbsp;</a></div>&#39;;
}
if($section_index < $count_sections){

echo "<hr />";

}
?>

--- End code ---

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.

Navigation

[0] Message Index

[*] Previous page

Go to full version