Author Topic: Droplet works fine on local host but not on my hostserver  (Read 4989 times)

Offline midiweb

  • Posts: 181
Droplet works fine on local host but not on my hostserver
« on: February 16, 2009, 10:57:16 PM »
hi, I use the droplet ShowSection to display some pictures in my sidebar menu (main navigation)
All works fine on local but on my webhost, no pictures are displayed but only the command

Code: [Select]
       [[ShowSection?section=11]]
I inserted the code in the index.php of my template:

Code: [Select]
<div id="sidebar">
                    <div class="subtabs">
                        <?php show_menu2(2,0,1); ?>
[[ShowSection?section=11]]
                    </div>

here's the complete code:



<?php

Code: [Select]
/*

 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

*/
// allows to include optional module files (frontend.css, frontend.js) into the head

// allows to include optional module files (frontend.css, frontend.js) into the head


if(function_exists('register_frontend_modfiles')) {
  register_frontend_modfiles('css');
  register_frontend_modfiles('js');
}

if(!defined('WB_URL')) {
    header('Location: ../index.php');
    exit(0);
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title><?php echo WEBSITE_TITLE?> - <?php echo PAGE_TITLE?></title>
        <meta http-equiv="Content-Type" content="text/html; charset=<?php if(defined(&#39;DEFAULT_CHARSET&#39;)) { echo DEFAULT_CHARSET; } else { echo &#39;utf-8&#39;; }?>" />
        <meta name="description" content="<?php page_description(); ?>" />
        <meta name="keywords" content="<?php page_keywords(); ?>" />

        <link href="<?php echo TEMPLATE_DIR?>/industry.css" rel="stylesheet" type="text/css" media="screen" />
    </head>
    <body>
        <div id="main">
            <a name="top" class="nodisplay"></a>
            <div id="hero"> </div>
                        <div id="hero2"> </div>
            <div id="header">
                <!-- <div class="gear"> </div> -->
                <div class="gear"> </div>
                        <?php show_menu(1,0,1,true,&#39;<li><span[class]>[a][menu_title] [/a]</span>&#39;,&#39;</li>&#39;,&#39;<ul id="nav">&#39;); ?>

                <h1 class="shad"><em><?php echo WEBSITE_TITLE?></em></h1>
                <h1><em><?php echo WEBSITE_TITLE?></em></h1>
            </div>

            <div id="wrapper">
                <div id="sidebar">
                    <div class="subtabs">
                        <?php show_menu2(2,0,1); ?>
[[ShowSection?section=11]]
                    </div>
                   
                    <?php 
                        ob_start
();     // start output buffer
                        
global $database;
                        
$limit 10;
                        
$query "SELECT post_id,title,content_short,group_id,link FROM ".TABLE_PREFIX."mod_news_posts ORDER BY position DESC LIMIT 0, $limit;";
                        
$error mysql_error();
                        if (!
$result mysql_query($query)) {
                            print 
"$error";
                            exit;
                        }
                        while(
$data mysql_fetch_object($result)){
                            
$title $data->title;
                            
$id $data->post_id;
                            
$link $data->link;
                            
$short $data->content_short;
                            echo &
#39;<p><a href="&#39;.WB_URL.&#39;/pages/&#39;.$link.PAGE_EXTENSION.&#39;">&#39;.$title.&#39;</a><br />&#39;.$short.&#39;</p>&#39;;
                        
}
                        
$foo=ob_get_contents();    // put outputbuffer in $foo
                        
ob_end_clean();             // clear outputbuffer
                    
?>

                </div>
                <div id=aktuelles>
                <?
                    if ($foo<>"") {  // some code to execute cause there is some block
//                            echo '<h4>Aktuelles</h4>';
                            echo $foo;
                        } else { // some code for no info
                            echo '<h1>No New News</h1>';
                            }
                ?>
                </div>

                <div id="content">
                    <?php page_content(); ?>
                </div>
                            </div>
           
            <div id="footer">
                <?php page_footer(); ?><br><br>
               
            </div>
        <div style="clear:both;"></div>
    </div>

    </body>
</html>

have I to define some parameters as explained in the example:
Code: [Select]
[[ExampleDroplet?dir=mydir&width=300&height=200]]
What's "dir" ? is it the directory of the called page?

Who can help me?

Friendly yours

Offline Hans

  • Posts: 914
  • Gender: Male
Re: Droplet works fine on local host but not on my hostserver
« Reply #1 on: February 16, 2009, 11:10:43 PM »
Your Droplet doesn't need any additional parameters. Are you sure you enabled (installed) the Droplet module in the WB version on your host and that section 11 exists? Does this section contain the pictures you want to show?
Maybe its all obvious to you but sometimes these little things can drive you crazy if you didn't think about it. So just in case..
Hans

EDIT (see posting from PCWACHT hereunder): As far as I know the ShowSection Droplet isn't included in the standard package so you have to add it to the existing droplets after installing the module itself.
http://www.websitebakers.com/pages/droplets/official-library/content/showsection.php
Hans
« Last Edit: February 16, 2009, 11:29:44 PM by Hans »
Hans - Nijmegen - The Netherlands

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: Droplet works fine on local host but not on my hostserver
« Reply #2 on: February 16, 2009, 11:23:16 PM »
Quote
All works fine on local but on my webhost, no pictures are displayed but only the command

If you see the droplet ie: [[dropletname]] in your output then droplets is NOT  installed correctly.



John
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

Offline midiweb

  • Posts: 181
Re: Droplet works fine on local host but not on my hostserver
« Reply #3 on: February 17, 2009, 12:01:24 AM »
hi, in Admin.Tools, Droplets are installed:

Code: [Select]
Droplets
This tool allows you to manage your local Droplets. (v0.3 - jan 31 2009)

The ShowSection is not a standard droplet and I had to copy and to paste the code myself
The page ID is 11. I see it in the adress line of the browser:

Code: [Select]
page_id=11
I don't know what I did wrong.


Offline midiweb

  • Posts: 181
Re: Droplet works fine on local host but not on my hostserver
« Reply #4 on: February 18, 2009, 12:57:56 AM »
No one knows? I did exactly the same droplets installation on the server as on local.

The droplet text is displayed instead of the results. I don't understand.


Offline marathoner

  • Posts: 495
Re: Droplet works fine on local host but not on my hostserver
« Reply #5 on: February 18, 2009, 03:15:52 AM »
Is your production server configured the same as your local server? I'd guess that's where the problem is.

aldus

  • Guest
Re: Droplet works fine on local host but not on my hostserver
« Reply #6 on: February 18, 2009, 09:36:04 AM »
Quote
[...] The droplet text is displayed instead of the results. [...]
As for me i realy got trouble to understand this line of text:
do you mean the "droplet"-name, e.g. "[[showMyDropplet]]" or
do you mean the droplet-code itselft????

If you droplet isn't parsed it could be a permission problem of the modul itselft (644??, 744 instead of 755,775),
but i assumee an typos in the name.

as for the droplet-php code itselft i would place some changes to
get more details if something is going wrong, e.g.
Code: [Select]
<?php // ignore this line - it&#39;s only for the syntax-colouring
global $database$wb;

ini_set(&#39;display_errors&#39;, 1);
error_reporting(E_ALL);
    
$get_content $database->query("SELECT content FROM ".TABLE_PREFIX."mod_wysiwyg WHERE section_id = &#39;".$section."&#39;");

/**
 *    Any errors? If so ... we simple returning the err-message from the db
 */
if ( $database->is_error() ) return $database->get_error();

/**
 *    No errors but also no result: section_id doesn&#39;t match?
 */
if ($get_content->numRows() == 0) return "Sorry - no section_id match for ".$section;

/**
 *    No errors and at least one result ... we&#39;re taking the first one
 */
$fetch_content $get_content->fetchRow();
$content $fetch_content[&#39;content&#39;];

$wb->preprocess($content);

return 
$content;

?>


Also differ PHP Versions could be an issure, so what php version is running on the server (phpinfo)?
Also: have you deinstalled and reinstalled the droplet-module or have you replaced the files via ftp?
If so - i guess it's the permission as the ftp-user doesn't have //right// to execute.

Regards
Aldus

Offline midiweb

  • Posts: 181
Re: Droplet works fine on local host but not on my hostserver
« Reply #7 on: February 18, 2009, 10:41:49 AM »
Thanks. I see the droplets name with the double brackets.
Yes I desinstalled and reinstalled the droplets module twice and it 's displayed, it would be properly installed.
I see the droplets list in the backend under Admin-Tool.

I check up now  the write rights of the directories.

Here are the server information:


Code: [Select]
Apache version    1.3.41 (Unix)
PHP version    5.2.5
MySQL version    5.0.67-community
Architecture    i686
Operating system    Linux
Kernel version    2.6.18-92.1.10.el5

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: Droplet works fine on local host but not on my hostserver
« Reply #8 on: February 18, 2009, 01:38:50 PM »
The droplet is NOT properly installed, or you have an older version of WB


Check following:
 index.php in the root needs to have
Code: [Select]
if(file_exists(WB_PATH .'/modules/output_filter/filter-routines.php')) {
somewhere around line 82

Allso during installation of droplets, the install routine will try to modify a file in /modules/output_filter

One of these seems lacking on your second install.


John
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

Offline midiweb

  • Posts: 181
Re: Droplet works fine on local host but not on my hostserver
« Reply #9 on: February 18, 2009, 02:57:04 PM »
I use wb2.7. From  the line 89 in my index.php in the root of the server (public_html) I have this:

Code: [Select]

if(file_exists(WB_PATH .'/modules/output_filter/filter-routines.php')) {
    // include the output filter module routines
    @require_once(WB_PATH .'/modules/output_filter/filter-routines.php');
   
    if(function_exists('filter_frontend_output')) {
        // store output in variable for filtering
        @ob_start();
        require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
        $frontend_output = ob_get_contents();
        @ob_end_clean();
        // Display the filtered output on the frontend
        echo filter_frontend_output($frontend_output);
        die;
    }
}    



I've just deinstalled and tried to reinstall the droplets on the server: after installing, here what I get:


Code: [Select]
Droplet import: SiteModified
Droplet import: SearchBox
Droplet import: Oneliner
Droplet import: Skype
Droplet import: PreviousPage
Droplet import: NextPage
Droplet import: ParentPage
Droplet import: Lorem
Droplet import: Text2Image
Droplet import: RandomImage
Droplet import: LoginBox
Droplet import: ModifiedWhen
Patching frontend output filter.......
« Last Edit: February 18, 2009, 03:06:36 PM by midiweb »

Offline midiweb

  • Posts: 181
Re: Droplet works fine on local host but not on my hostserver
« Reply #10 on: February 18, 2009, 03:18:24 PM »
waouw, It works now great. I pasted the following line in the filter-routines.php and not in the index.php:

Code: [Select]
// run the droplets function
if(file_exists(WB_PATH .'/modules/droplets/droplets.php')) {
    include_once ( WB_PATH .'/modules/droplets/droplets.php');
    $content = evalDroplets($content);
}

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: Droplet works fine on local host but not on my hostserver
« Reply #11 on: February 18, 2009, 03:22:03 PM »
Glad to see it is working...



John
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....