Welcome, Guest. Please login or register.
Did you miss your activation email?
February 12, 2012, 06:15:45 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
149621 Posts in 21098 Topics by 7537 Members
Latest Member: lotte2
* Home Help Search Login Register
Pages: 1 [2] 3 4   Go Down
Print
Author Topic: New Module - Section Picker (aka Global Blocks)  (Read 15290 times)
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4753



« Reply #25 on: October 21, 2008, 11:04:08 PM »

You can just upgrade.
No need to uninstall first.
Yesss.
That worked!

Cool Module, really. I love this one.

Best regards,
Stefek
Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
gucci

Offline Offline

Posts: 46


« Reply #26 on: October 24, 2008, 12:15:48 PM »

Hallo Ruud,

I have installed Section Picker on my local PC (XAMP), wb27.
On the buttons I can see php-code huh
(See the picture below)

Regards Gucci
Logged
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2093



WWW
« Reply #27 on: October 24, 2008, 01:44:51 PM »

Hi Gucci,

The modify.php was using so called short_open_tags. (<? instead of <?php )
This should not be done anymore (good coding practice), but most hosts will allow code to use the short tags anyway.
If you want to check first, it is a setting in your php.ini. (short_open_tag = Off)

I fixed this in a new version (v0.23). I think/hope this will solve your issue.
You can download the new version in the first post of this thread.

Ruud
Logged

Professional WebsiteBaker Developer
gucci

Offline Offline

Posts: 46


« Reply #28 on: October 24, 2008, 02:09:13 PM »

Hello Ruud,

many thanks for the quick correction.  Now it works fine!

Best regards

Gucci
Logged
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4753



« Reply #29 on: October 27, 2008, 03:53:01 PM »

Hoi Ruud!

I have one suggestion for this great module.
I don't know if this is doable.

When I have one section selected, I would love to have a link like "edtit this section" and if this link would popup a new browser window directly to this section.

Is this possible somehow?

Best Regards,
Stefek
Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2093



WWW
« Reply #30 on: October 27, 2008, 04:07:02 PM »

I don't think it is possible to edit just one section with the core WB.
You will have open/edit the complete page that includes the linked section.
Unfortunately the page_id is for the selected section is not stored, so it will be a bit more work than adding a simple javascript link.

I will have a better look some evening this week and see if I can add something nice wink
You know I like to keep you happy.

Ruud
Logged

Professional WebsiteBaker Developer
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4753



« Reply #31 on: October 27, 2008, 04:19:17 PM »

You know I like to keep you happy.
grin


Dear Ruud.
I don't understand the matter so much.

But when I am for example by /admin/pages/sections.php?page_id=7 and I have more than one section in it and then I klick of one of these links, I will be landed by exactly this section.

What I think about is to use the same "behavior" but in the new window (for that case that you didn't understand what I am thinking about exactly).

Best Regards,
Stefek
Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
vyni

Offline Offline

Posts: 566


« Reply #32 on: October 27, 2008, 09:56:36 PM »

Hi together,

sometimes I read articles and than I play around (because I´m too bored grin).
So in this case too.
I was wondering if this could be done easy - just editing one section. So I had a look into the modify.php in admin/pages.

If You change line 101 which is
Code:
$query_sections = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' ORDER BY position ASC");
to something like
Code:
$query_sections = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' AND section_id='$post_section' ");
and save it in the same directory as modify2.php
You get only exactly this one section to the screen.
Now declare $post_section in a usable way (You will better know than me how to do that) and add a button wherever You want, which sends the section_id to modify2.php - voila. The rest is pipifatz. Maybe there is a redirect after saving to change - maybe annother little line - who knows?

I (copy & paste specialist) would do it like this - even if a specialist would say "no way"!
Logged

PS: Falls jemand eine Idee hat was zu tun ist und mir das erklären könnt - geh bitte davon aus dass ich ahnungslos bin, was php und so betrifft. Ich kann grad was lesen, kopieren und einfügen,  ungefähr verfolgen und glauben.
roedental

Offline Offline

Posts: 80



WWW
« Reply #33 on: November 24, 2008, 12:25:35 PM »

Hey,
are there any problems known, because I can install the module,then I can add it to a page, but if I try to use it and open the page in the backend, the site  will not open, and I have to restart the browser.

Sven
Logged
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2093



WWW
« Reply #34 on: November 24, 2008, 12:43:19 PM »

The only reason I can think of is that you have a site with a lot of pages.
Building the list of all pages and sections might generate a timeout there.

Ruud
Logged

Professional WebsiteBaker Developer
amitmalka

Offline Offline

Posts: 28


« Reply #35 on: November 25, 2008, 09:20:56 PM »

demo please...
Logged
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2093



WWW
« Reply #36 on: November 25, 2008, 09:44:08 PM »

demo please...

This module displays a webpage. Not much to demo there.

The backend is nothing more than a list of all sections of your site.
The AMASP site has a screenshot.

Ruud
Logged

Professional WebsiteBaker Developer
mad_nico

Offline Offline

Posts: 8


« Reply #37 on: July 23, 2009, 10:07:45 AM »

Hi,

I installed the module, I created a new (hidden) page and assigned it to a predefined block in the template. The content will be displayed for the pages I can assign the section. But is there an option to assign sections to pages, which are normally not displayed within the admin area such as /account/forgot.php and other?

regards, Nico
Logged
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2093



WWW
« Reply #38 on: July 23, 2009, 12:38:54 PM »

No, those pages do not have a sectionid.

You can create your own section/page (i.e. using a code section) that displays the same form and link that one.

R

Logged

Professional WebsiteBaker Developer
Xagone
AddOn Development
*
Offline Offline

Posts: 453



WWW
« Reply #39 on: September 03, 2009, 09:34:02 PM »

i've tried to make it show sections block names

i've modified the select pages.php file to this :
Code:
<?php

/**

*    Recursive function to build a list of pages and subpages

*

*    @version:    0.1.1

*    @date:        2008-10-19

*    @author:    RuudE

*    @package:    WebsiteBaker - Modules: selection-picker

*    @state:        @dev

*

*

*/
/*
include('/home/xagone/public_html/www.cochondingue.com/templates/cochon_pages/info.php');
print_r($block);*/

function build_pagelist($parent,$this_page,$blocks false$default_template false) {

    global 
$database$links$default_template,$blocks;

    if(empty(
$default_template)) {
    
// what is the default template  addon_ID ? 
        
$dtquery $database->query("SELECT `value` FROM `".TABLE_PREFIX."settings` 
                                                     WHERE `name` = 'default_template'"
);
        
$dtrep $dtquery->fetchRow();
        
$default_template $dtrep['value'];
    }
    
    
// blocks array will contain all blocks names
    
if(empty($blocks)) {
        
$blocks = array();
    
        
/*
        this will give a $blocks array this way : 
        blocks[
                addon_id[
                         block_id = > name of the block
                         ]
                ]
        */
        // found all templates available
        
if($requete=$database->query("SELECT `directory` FROM `".TABLE_PREFIX."addons` WHERE `function` LIKE 'template'")) {
            
#echo "SELECT `directory` FROM `".TABLE_PREFIX."addons` WHERE `function` LIKE 'template'";
            // loop trought temlates
            
while($rep $requete->fetchRow()) {
                unset(
$block);
                
// include the info to get all blocks
                
require_once(WB_PATH.'/templates/'.$rep['directory'].'/info.php');
                
                
$blocks[$rep['directory']] = array();
                
                
                
// if there is blocks
                
if(is_array($block)) {
                    
// for each block we ad it to the array

                    
foreach($block as $cle => $valeur) {
                        
$blocks[$rep['directory']][$cle] = $valeur;
                    }
                    
// unset the block array to be sure to have no leftover for the next loop
                
}
            }
        }
    }
    
$table_p TABLE_PREFIX."pages";

    
$table_s TABLE_PREFIX."sections";

    if ( 
$query_section_id $database->query("SELECT s.section_id,s.block,s.module,p.link,p.page_title,p.page_id,p.level,p.template FROM ".$table_s." s join ".$table_p." p on (s.page_id = p.page_id) WHERE p.parent = ".$parent." order by p.position")) {
        
        while(
$res $query_section_id->fetchRow()) {
                        
            if (
$res['page_id'] != $this_page) {
                
                if(empty(
$res['template'])) { $t_id $default_template; } else { $t_id $res['template']; }
                
                if(!empty(
$blocks[$t_id][$res['block']])) { 
                    
$le_block_name ':'.$blocks[$t_id][$res['block']]; 
                } else {
                    
$le_block_name '';
                }
                
                    
$links[$res['section_id']] = $res['section_id'].'|'.str_repeat("  -  ",$res['level']).$res['page_title'].'    -    section:'.$res['module'].$le_block_name;    
                    
                
build_pagelist($res['page_id'],$this_page,$blocks,$default_template);

            }

        }

    }

}

?>

it works in wb 2.8, but i've got 1 templates that do not show his section blocks... only one, i've been rocking my head on the wall for that one, because i need it on that f*&? template to show me witch block i'm coping.. but it doesnt work for only that template!!!!!!! i'm going crazy. i dont ask to help me, i'm just giving my code that works.
Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
masarin

Offline Offline

Posts: 51


« Reply #40 on: September 11, 2009, 04:38:45 PM »

Nice module!

I'm trying to use it with MP3 Audio Player:
http://www.websitebakers.com/pages/modules/player/flash-mp3-player.php

The Player moudule uses it's own CSS.
The changes I made to the Player CSS doesn't show when using a Section Picker sektion
Logged
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2093



WWW
« Reply #41 on: September 11, 2009, 07:55:01 PM »

The frontend css will not be loaded through the section picker.
WB will look for a frontend css in the module that is active, in this case the section picker.
Just place the css in your main Itemplate) css file and it should work.

Ruud
Logged

Professional WebsiteBaker Developer
masarin

Offline Offline

Posts: 51


« Reply #42 on: September 14, 2009, 09:28:32 AM »

Ok Thank you I will try that
Logged
gottfried

Offline Offline

Posts: 807


« Reply #43 on: November 17, 2009, 01:20:22 PM »

Hi !  smiley

I installed the newest section picker module from websitebakers.com on a wb2.7.
Then I  selected a "sectionpicker section" as a section in the backend.
Then there was the segment  of the sectionpicker in the modify page page,
but no entry in the list where the existing section should be selectable.

My Installation seems to be ok till now and i installed other modules after sectionpicker that work.
What can be wrong? Save mode is on !
Logged
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2093



WWW
« Reply #44 on: November 17, 2009, 11:30:23 PM »

Then there was the segment  of the sectionpicker in the modify page page,
but no entry in the list where the existing section should be selectable.
The sectionpicker section will not be in the list. (intentionally)
The idea is to select any other section of your website to be shown on that position.
Do you see the other pages:sections?
Logged

Professional WebsiteBaker Developer
gottfried

Offline Offline

Posts: 807


« Reply #45 on: November 19, 2009, 10:13:26 AM »

Hallo Ruud !

beg your pardon for my bad english.

Quote
Do you see the other pages:sections?

No - the drop down list has no entries.

there is only
Code:
       <td>
            <select name="target_section_id_234" style="font-family:monospace; width:500px;" />
                <option value="0" selected>Bitte ausw&auml;hlen</option>
                        </select>

        </td>

the german Text for please choose as select
Logged
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2093



WWW
« Reply #46 on: November 19, 2009, 08:58:17 PM »

This list is built directly from the database and should not fail.
Did you try to set the error reporting to E_ALL and see if there are any errors reported?
Logged

Professional WebsiteBaker Developer
gottfried

Offline Offline

Posts: 807


« Reply #47 on: November 20, 2009, 03:47:33 PM »

Puuh .... php error log  huh

 cheesy when I switch on E_ALL for errorreporting in the Backend I see some errormessages in the frontend then (related to random image - but it works ?!), but they are not related to the Problem. There are no errormessages in the backend on the page with the section picker.

There also seems to be no php errors in the logfile of my hoster (strato).
But I do not know wether there are php errors normally in.




Logged
gottfried

Offline Offline

Posts: 807


« Reply #48 on: November 21, 2009, 10:53:05 AM »

Hi Ruud!  grin

I made a test. put some echos in build pagelist  huh

Code:
<?php
/**
*    Recursive function to build a list of pages and subpages
*
*    @version:    0.1.1
*    @date:        2008-10-19
*    @author:    RuudE
*    @package:    WebsiteBaker - Modules: selection-picker
*    @state:        @dev
*
*
*/
function build_pagelist($parent,$this_page) {
    global 
$database$links;
    
    
$table_p TABLE_PREFIX."pages";
    
$table_s TABLE_PREFIX."sections";

echo(
"test1");
    
    if ( 
$query_section_id $database->query("SELECT s.section_id,s.module,p.link,p.page_title,p.page_id,p.level FROM ".$table_s." s join ".$table_p." p on (s.page_id = p.page_id) WHERE p.parent = ".$parent." order by p.position")) {
echo(
"test2 ");
        while(
$res $query_section_id->fetchRow()) {
echo(
"test3 ");
            if (
$res['page_id'] != $this_page) {
echo(
"test4 ");
                
$links[$res['section_id']] = $res['section_id'].'|'.str_repeat("  -  ",$res['level']).$res['page_title'].'    -    section:'.$res['module'];
                
build_pagelist($res['page_id'],$this_page);
echo(
"test5 build_pagelist()");
            }
        }
    }
}
?>

the output in the backend is

Quote
test1test2 test3 test3 test3 test3 test3 test3 test3
Abschnitt:    

test 4 and test 5 are never reached.  shocked

it has to do with
Code:
if ($res['page_id'] != $this_page)

The page where the section picker is is the first level page. Can it have to do with that ?  smiley


Yes - it was !

I tried the secitionpicker on a deeper level page. There it works.

Hm... Now I know how i can use it. But it seems not to be possible to collect some sections
from deeper levels on the first page.

I suppose one could take the recursive build_pagelist out of the if statement.
then this_page is also excluded from the list.  Huh?? Don't know exactly how it works.





« Last Edit: November 21, 2009, 11:21:00 AM by gottfried » Logged
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2093



WWW
« Reply #49 on: November 25, 2009, 12:47:44 PM »

Thanks for reporting..

I will do some testing and see if I can fix this.

R
Logged

Professional WebsiteBaker Developer
Pages: 1 [2] 3 4   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!