Author Topic: New Module "OneForAll"  (Read 46396 times)

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
New Module "OneForAll"
« on: December 19, 2014, 04:16:57 PM »
NEW MODULE "ONEFORALL"

DESCRIPTION
OneForAll is a WebsiteBaker module that is versatile like a chameleon.

It can be installed more than one time on the same WebsiteBaker installation by setting a different module name in the info.php file before uploading and installing. Furthermore the module provides the feature to add highly customized pages. On the one hand you can define custom fields as many as you need in the backend and on the other hand free definable html templates for the frontend output.

By default OneForAll provides just one title field and an image upload. Additionally you can add unlimited custom field types like text, textarea, wysiwyg editor, WB link, external link, email, select a file from a subdirectory of media, WB droplets, datepicker, datetimepicker and others.

Items can be displayed in an overview and if needed in a corresponding detail page. OneForAll provides pagination and on detail pages previous- | back- | next-links.

OneForAll makes use of the Lightbox2 JavaScript to overlay item images on the current page.


KNOW HOW

1. Renaming and installing the module
Before installing the module you have to rename it:
  • Open the moduls zip locally.
  • Open the file info.php in a text editor.
  • Change the current module name "OneForAll" (about line 43) to another name that matches the module's scope of data handling, eg. "Xmas".
  • Allowed characters are a-z, A-Z, 0-9, - (hyphen), _ (underscore) and spaces. Min 3, max 20 characters.
  • Note that the module name must be unique.
  • Re-zip the module files.
  • Install the module zip as usual.

2. Adding custom fields
After installing the module successfully you have to add some fields:
  • Login to your WebsiteBaker installation.
  • Add a new page with page type "Xmas".
  • Go to the "Fields Settings" and add the customized fields you intend to collect the data.
  • Select the field type and modify the field templates to fit your needs.
  • Note that every field must have a unique field name. Allowed characters are a-z, A-Z, 0-9, . (dot), _ (underscore) and - (hyphen).
  • Consider the generated placeholders! You will need them later when adding the item templates.

3. Adding item templates
Create your own item templates using the above mentioned generated placeholders and additionally some general placeholders:
  • Go to the "Page Settings" and set the placeholders into your templates to view the items just the way you want.
  • Remember [PLACEHOLDERS] are uppercase and enclosed by square brackets.
  • For a list of all general placeholders to accomplish your template click the "Help"-button on top of the "Page Settings".
  • Add an item or two, enter some data and have fun!


SETTINGS
There is a config.php file in the package to preset some rarely used settings.

DOWNLOAD
Download the zip attachment from this post (see below).

FEEDBACK
Feel free to test. Please make any suggestions or post bug reports in this thread.
Thank you!


Christoph
« Last Edit: December 31, 2014, 12:51:59 PM by Argos »

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #1 on: December 31, 2014, 12:43:55 PM »
New Version of OneForAll:

VERSION 0.2 (12/31/2014)

VERSION HISTORY
Thanks a lot for testing, bug reports and further feedback to fischstäbchenbrenne r and jacobi22.
  • Bugfix: Various small fixes for PHP 5.3
  • Changed: OneForAll now sets a default item title if user has left it blank
  • Bugfix: Fixed PHP include pathes using dirname(__FILE__)
  • Bugfix: Display settings to admin only
  • Bugfix: If an item field is empty, prevent field data of previous items to be displayed
  • Bugfix: Fixed fatal error when deleting an item
  • Bugfix: When deleting an item also delete the corresponding item fields
  • Added various $admin->add_slashes() and stripslashes()
  • Checkbox "sync_type_template" is now checked by default and saved in the session
  • Bugfix: Display [[Droplet]] instead of droplet id
  • Bugfix: When saving an item, occasionally the page access file was deleted wrongly
  • Changed: Made renaming of the module optional

KNOW HOW
Further information can be found on the first post of this thread.

DOWNLOAD
Download the zip attachment from this post (see below).


Christoph
« Last Edit: January 13, 2015, 12:13:42 PM by Argos »

Offline Argos

  • Posts: 2542
  • Gender: Male
    • Argos Media
Re: New Module "OneForAll"
« Reply #2 on: December 31, 2014, 12:58:13 PM »
Cooooooooool! Custom fields/pages for WB! That's a VERY important step forward to keep WB alive, and much missed until now (at least by me). I'm looking forward to see further development of this module. Thanks alot freesBee!
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

Offline crnogorac081

  • Posts: 1899
  • Gender: Male
Re: New Module "OneForAll"
« Reply #3 on: January 05, 2015, 01:01:58 AM »
im going to test it. thumbs up !
no bb in signature

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #4 on: January 22, 2015, 01:54:48 PM »

New Version of OneForAll:

VERSION 0.3 (01/22/2015)


VERSION HISTORY
  • Fixed some warnings which were thrown when no fields had been defined (reported by BlackBird)
  • Bugfix: When saving a new item, the page access file still was deleted by mistake
  • Added option to deactivate item detail pages and suspend corresponding access files.
    See settings at config.php (suggested by jacobi22)
  • Added field type group. Items are grouped on the overview page. (suggested by jacobi22)
    • Note: Just one group field allowed!
    • Also see group settings for headers and ordering at config.php

KNOW HOW
Further information can be found on the first post of this thread.

DOWNLOAD
Download the zip from this download link.


Christoph

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #5 on: February 06, 2015, 10:17:40 AM »

New Version of OneForAll:

VERSION 0.4 (06/22/2015)


VERSION HISTORY
  • Bugfix: If png image file is not resized keep jpg file extension
  • Bugfix: Field wb_link now allows to select sibling as well as ancestor pages
  • Changed general placeholder [EMAIL] to [USER_EMAIL] to prevent conflicts with customized email field
  • Bugfix: Prevent conflicts between customized field names and general placeholders
  • Bugfix: Fixed fatal error "Cannot redeclare show_wysiwyg_editor()" when using more than one wysiwyg editor (reported by instantflorian)
  • Bugfix: Fixed shifted option of field type select (reported by instantflorian)

KNOW HOW
Further information can be found on the first post of this thread.

DOWNLOAD
Download the zip from this downlaod link.


Christoph

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: New Module "OneForAll"
« Reply #6 on: February 09, 2015, 12:08:33 PM »
@Freesbee

I wrote contents, back in 2011, it could do simular, maybe you can use parts/ideas etc
See: http://forum.WebsiteBaker.org/index.php/topic,20672.msg153468.html#msg153468

Have fun!

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

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #7 on: February 09, 2015, 01:11:53 PM »
Hi John Is it the latest

Great, thanks for the info.
I downloaded your module from the post you have linked to. Is it the latest version or has there been more development?
I am greedy to have a look on it!

Regards Christoph

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: New Module "OneForAll"
« Reply #8 on: February 09, 2015, 08:19:56 PM »
As fas as I know it is the latest. I could look over my harddrives to see if I have something a bit more current.
As far as I know it had no faults left, only major drawback are the default templates wich show more then there is :)

Do look, I like the way comments can be nested (commenting on a comment), the way pagelinks are handled, the pagename bacomes the folder for the posts and some other things.

At the time 2011 there was not so much response to the module so I stopped working on it, I allso had (and still have) major healthissues wich hold me back on coding as well.

There is a readme wich hold all the contentplacers, and some info on stuff wich wasn't coded yet.

Since yours is somewhat simular in idea I pointed to the module, hope you like it and can use some idea's or codebits for yours.

If I could help, just let me know.

John

PS Checked my harddrive, nothing newer.
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

Offline empx

  • Posts: 4
Re: New Module "OneForAll"
« Reply #9 on: February 17, 2015, 12:15:49 PM »
It's a very nice modul, it would perfect work for a Blogging System it's also very comfortable that every thing can defined as the user wants it.

May there be a problem with the Groups because they always will be postet even if it's not declared in the current template?

Currently i'm trying to work around that the groups are more usefull please let me know if there is currently a better way to use it because the only thing for now is to see in the backend in which group it was posted.
For me the Groups are only usefull if i can sort the posts by groups, i already do it but it would be cool if it's working native in frontend.

Another thing that may could be very usefull is to sort the posts within the groups (may in backend in "folders) for example:

Backend:

Group 1 |
            |->3rd post                 Date: 12.02.2015
            |->2nd post                 Date: 11.02.2015
            |->First post                 Date: 10.02.2015

Group 2 |
            |->3rd post                 Date: 12.02.2015
            |->2nd post                 Date: 11.02.2015
            |->First post                 Date: 10.02.2015

In frontend it could work like this:
Every defined group creates an own folder within that folder are the overview-posts and the detail-posts.

Then the frontend-menu could look like this:

"OneForAll-Site" | = Overview
                       |->1st Groupname
                       |->2nd Groupname
                       |->3rd Groupname

Overview:
displays all detail-posts of all groups sortet by post-date (newest first, no matter which group)

1st Groupname:
displays all detail-posts of the 1st Group sortet by post-date (newest first only this group)


and yes i know that i can use "OneForAll" as often as i want and i can duplicate content in those sites to get exactly that structure but as you may know Google and Co don't like duplicate content ;)


oh another thing i just forgot:
the idea with the lightbox is good, but please don't forget that people may use other light boxes like me for example, so i edited the script and put my own lightbox in, for me is no problem but if it should really be full user-editable it's may comfortable to let the user choose if the integrated lightbox will be used or a own one which may already is included by the template of the wb-site itself.

best regards empx
« Last Edit: February 17, 2015, 12:23:04 PM by empx »

Offline empx

  • Posts: 4
Re: New Module "OneForAll"
« Reply #10 on: February 18, 2015, 11:13:54 AM »

the idea with the lightbox is good, but please don't forget that people may use other light boxes like me for example, so i edited the script and put my own lightbox in, for me is no problem but if it should really be full user-editable it's may comfortable to let the user choose if the integrated lightbox will be used or a own one which may already is included by the template of the wb-site itself.

best regards empx

damn sorry just found out that there is an easy way to disable the box ;) i'm a little bit crazy :)

Offline empx

  • Posts: 4
Re: New Module "OneForAll"
« Reply #11 on: February 19, 2015, 10:35:13 AM »
if everyone is interessted to sort the posts in backend in order of the post date:

open the modify.php (websitebakerfolder/modules/oneforall/)
and change code line 115 to:

Code: [Select]
$query_items = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_".$mod_name."_items` WHERE section_id = '$section_id' AND title != '' ORDER BY modified_when DESC");
for ordering the posts (newest first) in frontend open view_overview.php and change line 97 (if groups are used) to:

Code: [Select]
$sql = "SELECT * FROM ".TABLE_PREFIX."mod_".$mod_name."_items ORDER BY modified_when DESC".$limit_sql;
and if no groups are used line 101 to:

Code: [Select]
$sql = "SELECT * FROM ".TABLE_PREFIX."mod_".$mod_name."_items ORDER BY modified_when DESC".$limit_sql;
regards empx

Offline CodeALot

  • Posts: 430
  • Gender: Male
Re: New Module "OneForAll"
« Reply #12 on: April 08, 2015, 12:01:31 PM »
freeSbee for President. And King. And Emperor. And whatnot.
 
EXCELLENT addition, VERY flexible. Thank you!

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #13 on: April 08, 2015, 09:22:16 PM »
Thanks, CodeALot!

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #14 on: June 05, 2015, 02:27:49 PM »
New Version of OneForAll:

VERSION 0.5 (05/29/2015)


NEW FEATURES
  • Added option to set wysiwyg editor to full width or right column width (set in config.php)
  • Order items in the backend by position ascending or descending (set in config.php)
  • Added new field type oneforall_link (module name must be specified)
  • Added new field type foldergallery_link (section id(s) can be specified as csv)
  • Added new field type upload (target directory (subdirectory of media) must be specified as a relative path)


VERSION HISTORY
  • [config.php] Added option to set wysiwyg editor to full width (both columns = 100%) (suggested by dbs)
  • [install.php] Bugfix: On manual installation allow installation even though the uploaded directory name is identical to the new module directory name (compares lowercase)
  • [modify.php] Order items in the backend by position based on config.php setting
  • [modify.php] Fixed up and down arrows depending on ordering
  • [save_item.php] Bugfix: When incrementing the image position and the item had no image yet, db function returned NULL instead of 0
  • [view_item.php] Bugfix: Fixed pagination if items are ordered by position descending
  • [backend.js] Bugfix: Fixed jQuery function to sinc selected file with file link or preview thumb
  • [save_item.php] Bugfix: Under certain circumstances false images have been deleted (reported by Boudi)
  • [modify_fields.php] Bugfix: Added localisation of "Add new fields"
  • Added new field type oneforall_link (module name of renamed OneForAll module must be provided)
  • Added new field type foldergallery_link (section id(s) can be specified as csv)
  • Added new field type upload (target subdirectory of media must be specified as a path)
  • [view_overview.php] Added «None found» message if no active item is found

KNOW HOW
Further information can be found on the first post of this thread.

DOWNLOAD
Download the zip from this downlaod link.


Christoph

« Last Edit: June 05, 2015, 02:33:02 PM by freeSbee »

Offline CodeALot

  • Posts: 430
  • Gender: Male
Re: New Module "OneForAll"
« Reply #15 on: June 05, 2015, 03:25:02 PM »
You just can't stop ruling, can you? :)  :-D Thanks man!

Offline svsanchez

  • Posts: 479
Re: New Module "OneForAll"
« Reply #16 on: July 24, 2015, 07:16:21 PM »
What a GREAT module! There are just a few things I would like to know how to do:

1. How do I tell the module to create bigger thumbnails?
2. When I click on the thumbnail, I thought it would open the image with the lightbox effect, but instead it opens it on the whole page. How do I enable the lightbox effect? (I have the Lightbox checked in the "Item Details" section in the Page Settings).

Thank you!

Offline dbs

  • Betatester
  • **
  • Posts: 7977
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: New Module "OneForAll"
« Reply #17 on: July 24, 2015, 10:15:33 PM »
1. look into config.php of the module (line 72)
2. Maybe jQuery is not loaded? A link to problem page could help to help.


Offline dbs

  • Betatester
  • **
  • Posts: 7977
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: New Module "OneForAll"
« Reply #19 on: July 24, 2015, 10:56:11 PM »
jQuery is multiple loaded. Not good.

I see this:
Code: [Select]
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
...
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
...
<script type="text/javascript" src="http://www.lsg.com.gt/templates/round/jquery-1.4.2.js"></script>
...
...
<script>window.jQuery || document.write('<script src="http://creeser.org.gt/include/jquery/jquery-min.js"><\/script>')</script>


Should only one line and should load from ajax.googleapis.com, but not the old 1.3.2 version.
The last line come from module oneforall. Should be deactivated.

Offline svsanchez

  • Posts: 479
Re: New Module "OneForAll"
« Reply #20 on: July 24, 2015, 11:27:35 PM »
dbs, I removed the extra jquery calls just after I posted the link but you were quicker than me to check this. However, this didn't solve it.

Regarding the last line:

Code: [Select]
<script>window.jQuery || document.write('<script src="http://creeser.org.gt/include/jquery/jquery-min.js"><\/script>')</script>
How do I remove it? I checked my template's code but it is not there.

Offline dbs

  • Betatester
  • **
  • Posts: 7977
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: New Module "OneForAll"
« Reply #21 on: July 25, 2015, 09:13:45 AM »
You will find the line in two files.
view_overview.php (line 53) and view_item.php (line 45).

If this is commented out i hope the lightbox will work.

Offline svsanchez

  • Posts: 479
Re: New Module "OneForAll"
« Reply #22 on: July 28, 2015, 12:27:49 AM »
Hello dbs, I removed the line from both files, but unfortunately the lightbox still isn't working. What else could it be?

Offline dbs

  • Betatester
  • **
  • Posts: 7977
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: New Module "OneForAll"
« Reply #23 on: July 28, 2015, 07:22:26 AM »
Hi, next step...

Author says:
Quote
If you already use jQuery on your page, make sure it is loaded before lightbox.js. jQuery 1.7 or greater is required.
http://lokeshdhakar.com/projects/lightbox2/#getting-started

Offline svsanchez

  • Posts: 479
Re: New Module "OneForAll"
« Reply #24 on: July 28, 2015, 07:49:09 AM »
Hello dbs, I got it right by using jquery 1.7.1 instead of 1.4.1 :)

One last question: how can I define the main image thumbnail to be bigger than the rest of the thumbnails? I currently set the thumbnails to 200px wide, but I would like to show the main image as a 500px wide and the rest of the thumbnails as 125px wide. Is this possible?

Thanks again!