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

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #50 on: November 28, 2015, 07:05:57 PM »
Hi CodeALot

This snippet displays the linked title of all OneForAll items on any page you want.
Requires the module OneForAll or rather the renamed version of OneForAll.

Install the attached code snippet via the WB backend:
Add-Ons -> Modules -> Install Module

Function can be invoked from the template or a code section. Call:
Code: [Select]
if (function_exists('oneforall_allitems')) {
oneforall_allitems($module_name[, $max_items = null]);
}

Example for all items of the OneForAll module renamed to projects:
Code: [Select]
if (function_exists('oneforall_allitems')) {
oneforall_allitems('projects');
}

Example for the last 5 items:
Code: [Select]
if (function_exists('oneforall_allitems')) {
oneforall_allitems('projects', 5);
}

Regards Christoph
« Last Edit: April 20, 2016, 12:16:21 PM by Luisehahne »

Offline CodeALot

  • Posts: 387
  • Gender: Male
Re: New Module "OneForAll"
« Reply #51 on: November 28, 2015, 09:27:22 PM »
Again, you're the best :) Your module is getting so damn good and versatile that you should open a Paypal-account for donations.
Just saying :)

Thanks!!!

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
OneForAll Datepicker format?
« Reply #52 on: November 29, 2015, 01:46:32 AM »
Hello,


I'am looking everywhere for this, where can I change the datepicker date format in OneForAll module.
Now it's 11/29/2015 but I need May 27th 2016. (I need this to show on frontend)


I wen't through all of the files but can't find it.


Thank you


R

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #53 on: November 29, 2015, 06:18:24 PM »
Hi Roych

OneForAll uses the jQuery datepicker widget. The dateFormat option is defined in the jQuery i18n localization you can find in your WB installation at /include/jquery/i18n/

Fortunately it is possible to change the dateFormat on initialization. For a full list of possible formats see the formatDate function:
https://api.jqueryui.com/datepicker/#utility-formatDate

In the module OneForAll the datepicker is initialized in the file functions.php at about line 390 as part of the php function field_datepicker(). It is used as well by the next 3 functions field_datepicker_start_end(), field_datetimepicker() and field_datetimepicker_start_end().

Search …
Code: [Select]
// Generate datepicker
function field_datepicker($field_id, $name, $label = 'Datepicker', $value = '') {
global $MOD_ONEFORALL, $mod_name, $nl, $t1, $t2, $t3, $t4, $t5;
$html  = $t1.'<script>'.$nl;
$html .= $t2.'$(function() {'.$nl;
$html .= $t3.'$("#datepicker_'.$field_id.'").datepicker({'.$nl;
$html .= $t4.'showOn: "button",'.$nl;
$html .= $t4.'buttonImage: "images/calendar.png",'.$nl;
$html .= $t4.'buttonImageOnly: true,'.$nl;
$html .= $t4.'buttonText: "'.$MOD_ONEFORALL[$mod_name]['TXT_JS_SELECT_DATE'].'"'.$nl;
$html .= $t3.'});'.$nl;
$html .= $t2.'});'.$nl;
$html .= $t1.'</script>'.$nl;
$html .= $t1.'<tr>'.$nl;
$html .= $t2.'<td width="20%" align="right">'.$label.':</td>'.$nl;
$html .= $t2.'<td>'.$nl;
$html .= $t3.'<input type="text" class="datepicker" name="fields['.$field_id.']" id="datepicker_'.$field_id.'" maxlength="20" value="'.$value.'" />'.$nl;
$html .= $t2.'</td>'.$nl;
$html .= $t1.'</tr>'.$nl;
return $html;
}

Replace …
Code: [Select]
// Generate datepicker
function field_datepicker($field_id, $name, $label = 'Datepicker', $value = '') {
global $MOD_ONEFORALL, $mod_name, $nl, $t1, $t2, $t3, $t4, $t5;
$html  = $t1.'<script>'.$nl;
$html .= $t2.'$(function() {'.$nl;
$html .= $t3.'$("#datepicker_'.$field_id.'").datepicker({'.$nl;
$html .= $t4.'dateFormat: "MM d yy",'.$nl; // Custom date format
$html .= $t4.'showOn: "button",'.$nl;
$html .= $t4.'buttonImage: "images/calendar.png",'.$nl;
$html .= $t4.'buttonImageOnly: true,'.$nl;
$html .= $t4.'buttonText: "'.$MOD_ONEFORALL[$mod_name]['TXT_JS_SELECT_DATE'].'"'.$nl;
$html .= $t3.'});'.$nl;
$html .= $t2.'});'.$nl;
$html .= $t1.'</script>'.$nl;
$html .= $t1.'<tr>'.$nl;
$html .= $t2.'<td width="20%" align="right">'.$label.':</td>'.$nl;
$html .= $t2.'<td>'.$nl;
$html .= $t3.'<input type="text" class="datepicker" name="fields['.$field_id.']" id="datepicker_'.$field_id.'" maxlength="20" value="'.$value.'" />'.$nl;
$html .= $t2.'</td>'.$nl;
$html .= $t1.'</tr>'.$nl;
return $html;
}


Unfortunately the jQuery datepicker dateFormat does not support the english ordinal suffixes "st", "nd", "rd" or "th" for the specified day as a format type. Gladly there is a workaround. Replace …
Code: [Select]
// Generate datepicker
function field_datepicker($field_id, $name, $label = 'Datepicker', $value = '') {
global $MOD_ONEFORALL, $mod_name, $nl, $t1, $t2, $t3, $t4, $t5;
$html  = $t1.'<script>'.$nl;
$html .= $t2.'$(function() {'.$nl;
$html .= $t3.'$("#datepicker_'.$field_id.'").datepicker({'.$nl;
$html .= $t4.'dateFormat: "MM d yy",'.$nl; // Custom date format
// Add english ordinal suffix to the day
$html .= $t4.'
onSelect: function(dateText, inst) {
        var day = inst.selectedDay, ordinal_day;
        ordinal_day = day + (["11","12","13"].indexOf(day) + 1 ? "th" : ["st","nd","rd"][(day % 10) - 1] || "th");
        $(this).val($(this).val().replace(day, ordinal_day));
    },'.$nl;
$html .= $t4.'showOn: "button",'.$nl;
$html .= $t4.'buttonImage: "images/calendar.png",'.$nl;
$html .= $t4.'buttonImageOnly: true,'.$nl;
$html .= $t4.'buttonText: "'.$MOD_ONEFORALL[$mod_name]['TXT_JS_SELECT_DATE'].'"'.$nl;
$html .= $t3.'});'.$nl;
$html .= $t2.'});'.$nl;
$html .= $t1.'</script>'.$nl;
$html .= $t1.'<tr>'.$nl;
$html .= $t2.'<td width="20%" align="right">'.$label.':</td>'.$nl;
$html .= $t2.'<td>'.$nl;
$html .= $t3.'<input type="text" class="datepicker" name="fields['.$field_id.']" id="datepicker_'.$field_id.'" maxlength="20" value="'.$value.'" />'.$nl;
$html .= $t2.'</td>'.$nl;
$html .= $t1.'</tr>'.$nl;
return $html;
}

Regards Christoph

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Re: New Module "OneForAll"
« Reply #54 on: December 01, 2015, 12:24:25 PM »
Thank you freeSbee it's working perfect. ;)


One question, are there any droplets made for oneforall out there for item listing?

R

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #55 on: December 01, 2015, 02:04:54 PM »
[EDIT:]

Post and attachments was outdated.

Find the new one here:  http://forum.WebsiteBaker.org/index.php/topic,27895.msg202492.html#msg202492

« Last Edit: January 07, 2016, 05:46:12 PM by DarkViper »

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Re: New Module "OneForAll"
« Reply #56 on: December 01, 2015, 08:06:20 PM »
You are awesome, thank you very much ;)


R (Y)

Offline CodeALot

  • Posts: 387
  • Gender: Male
Re: New Module "OneForAll"
« Reply #57 on: December 08, 2015, 09:57:15 AM »
Hi CodeALot

This snippet displays the linked title of all OneForAll items on any page you want.
Requires the module OneForAll or rather the renamed version of OneForAll.


 
Hello Christoph,
 
This (of course) works. Now let's assume that my OneForAll-module has items divided into 4 Groups.
How can I (if even possible) pull up a list like this snippet does, but then for 1 of the 4 groups only?

Example: I have 4 product groups in OneForAll: Chairs, Tables, Closets, Sofas
On a particular page, I want to show only the items from OneForAll that have the group Chairs.
 
Is something like this even possible?

Thanks again for even reading and thinking about it :)

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #58 on: December 08, 2015, 06:46:48 PM »
Hi CodeALot

This snippet displays the linked item titles of a specified OneForAll group on any page you want.
Requires the module OneForAll or rather the renamed version of OneForAll.

Install the attached code snippet via the WB backend:
Add-Ons -> Modules -> Install Module

Function can be invoked from the template or a code section. Call:
Code: [Select]
if (function_exists('oneforall_itemgroup')) {
oneforall_itemgroup($module_name, $view_groups = null [, $max_items = null]);
}

Example for the group Chairs of the OneForAll module renamed to furniture:
Code: [Select]
if (function_exists('oneforall_itemgroup')) {
oneforall_itemgroup('furniture', 'Chairs');
}

Add more than one group using comma separated values.
Example for the group Chairs and Tables of the OneForAll module renamed to furniture:
Code: [Select]
if (function_exists('oneforall_itemgroup')) {
oneforall_itemgroup('furniture', 'Chairs,Tables');
}

Limit the list to 5 items:
Code: [Select]
if (function_exists('oneforall_itemgroup')) {
oneforall_itemgroup('furniture', 'Chairs,Tables', 5);
}

Regards Christoph

« Last Edit: April 05, 2016, 09:17:24 PM by Luisehahne »

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Re: New Module "OneForAll"
« Reply #59 on: January 04, 2016, 10:34:42 PM »
Hello,


How can I modify Oneforall module so I can manage mp3 files? (upload, external-link and in-media-directory) fields.


It can only  manage  jpg .png .gif .svg and some others.


I have everithing in place but cant upload the mp3 with it.


Thank you


R

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Re: New Module "OneForAll"
« Reply #60 on: January 04, 2016, 11:28:09 PM »
Hello,


How can I modify Oneforall module so I can manage mp3 files? (upload, external-link and in-media-directory) fields.


It can only  manage  jpg .png .gif .svg and some others.


I have everithing in place but cant upload the mp3 with it.


Thank you


R


Got it, thx ;)

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #61 on: January 07, 2016, 10:54:51 AM »
Hi all

So fare I have made 4 module snippets for OneForAll. You can install them via the WB backend:
Add-Ons -> Modules -> Install Module

Of course it requires the module OneForAll or rather a renamed version of OneForAll.

Function can be invoked from the template or a code section. You may want to modify the small templates on top of the file include.php to fit your needs. Please see module description at the WB backend for information about the function arguments.

Example call:
Code: [Select]
if (function_exists('oneforall_topitems')) {
oneforall_topitems($section_id, $num_of_items);
}


  • OneForAll AnyItems

    This snippet displays a specified number of items of a given OneForAll module section.

  • OneForAll TopItems

    This snippet displays the top positioned items of all OneForAll sections.

  • OneForAll AllItems

    This snippet displays the linked title of all OneForAll items.

    http://forum.WebsiteBaker.org/index.php/topic,27895.msg201789.html#msg201789

  • OneForAll ItemGroup

    This snippet displays the linked item titles of a specified OneForAll group on any page you want.

Just have a look at them. It is also possible to convert these snippets into droplets.

Regards Christoph
« Last Edit: April 20, 2016, 12:15:28 PM by Luisehahne »

Offline dbs

  • Betatester
  • **
  • Posts: 7595
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: New Module "OneForAll"
« Reply #62 on: January 07, 2016, 12:00:55 PM »
Nice, will test it.  (Y)

Try at the moment the snippet bakeryslider to use with oneforall.
Works so far for image and title, but have some fields more to display (for a product). It's a catalog, not a shop.

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Re: New Module "OneForAll"
« Reply #63 on: January 08, 2016, 09:50:06 PM »
Hello


I'm having some weird problem with FOA module. I have a multilanguage site and the module name "news" on both, but the news are just getting duplicated everitime on both languages. So when I create item in one language it shows me the same news in all languages. So when on one language I see duplicated news, hope u understand ...


I could create a new module but then I can't move items ... and must make new css arangements for new one.


Any idea?


Thank you.


R

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #64 on: January 09, 2016, 08:21:54 AM »
Hi Roych

As far as I have understood you correctly you have renamed OneForAll to News.

1. Did you delete the original News module?
2. Did you create 2 News (OneForAll) pages, one for each language?
3. What happens, if you create an item?

An item can belong to only one page, but you can duplicate it to another one and then translate the item text (one item for each language).

Regards Christoph

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Re: New Module "OneForAll"
« Reply #65 on: January 09, 2016, 12:04:24 PM »
Hi Roych

As far as I have understood you correctly you have renamed OneForAll to News.

1. Did you delete the original News module?
2. Did you create 2 News (OneForAll) pages, one for each language?
3. What happens, if you create an item?

An item can belong to only one page, but you can duplicate it to another one and then translate the item text (one item for each language).

Regards Christoph


Hello


You are right. I have deleted the news module.
I renamed OFA module to "News" and created two news pages (News, Novice), one for each language with "news" OFA section.


When I create an item in one page, example "novice", it gets automaticaly duplicated in all language, so it shows me 2 same items in both languages.


So I create only 1 item and it gets duplicated for each language and are all shown in each language.

I'm using: WB Version 2.8.3 SP5 - Revision 1644

OFA: v 0.8



Thank you.


R
« Last Edit: January 09, 2016, 12:09:50 PM by Roych »

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #66 on: January 09, 2016, 12:57:45 PM »
Hi Roych

Sorry, I can't reproduce the behavior you are describing. Two more questions:

1. Do the two items have different item_id after they have been duplicated automatically?
2. What is the status (Active: No / Active: Yes) of the two items after duplication?

Regards Christoph

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Re: New Module "OneForAll"
« Reply #67 on: January 09, 2016, 01:33:23 PM »
Hi Roych

Sorry, I can't reproduce the behavior you are describing. Two more questions:

1. Do the two items have different item_id after they have been duplicated automatically?
2. What is the status (Active: No / Active: Yes) of the two items after duplication?

Regards Christoph


I played a little and I have now reinstaled the module, and create just one item under ENG language.


Now this item is seen only in ENG section OFA (item list), and not on other languages! So I guess it doesn't get duplicated, but It is shown in all languages in front-end.


I hope this is a better explanation


Thank you.


R

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #68 on: January 09, 2016, 01:51:25 PM »
Hi Roych

Weird - an item can belong to only one section - regardless back- or frontend. In other words: If an item belongs to the english OneForAll page, then it only shows up in the back- AND the frontend of the english page!

If you use a module snippet like oneforall_topitems then it will be different. See:
http://forum.WebsiteBaker.org/index.php/topic,27895.msg202492.html#msg202492

Regards Christoph

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Re: New Module "OneForAll"
« Reply #69 on: January 09, 2016, 02:07:42 PM »
I understan, I don't use any other snippet or droplet. I'm postin a screenshot of what I have an it should work.


I'm using it on some other sites and it works fine, so I don't understand what is the problem here.  :|



Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #70 on: January 09, 2016, 02:56:00 PM »
Hi Roych

Please check the section_id of the two oneforall sections. You can get them in the database > sections-table using a tool like phpMyAdmin.

Regards Christoph

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Re: New Module "OneForAll"
« Reply #71 on: January 09, 2016, 03:37:37 PM »
Hi Roych

Please check the section_id of the two oneforall sections. You can get them in the database > sections-table using a tool like phpMyAdmin.

Regards Christoph




I phpMyadmin shows same two section as in my backend or am I missing something?


I looked in "wb_mod_novice_page_ settings" -->section_id  ... Is this what you asked for? I get sections 75 and 81.


R

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #72 on: January 09, 2016, 03:48:12 PM »
I looked in "wb_mod_novice_page_ settings" -->section_id  ... Is this what you asked for? I get sections 75 and 81.

No, please go to the table "wb_sections". Look for the 2 rows where the field "module" is "novice". page_id probably are 75 and 81. What are the corresponding section_id's?

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Re: New Module "OneForAll"
« Reply #73 on: January 09, 2016, 03:58:50 PM »
Ok I'm posting a screenshot of phpmyadmin wb_sections.





Right one?

Offline freeSbee

  • Posts: 1117
    • BAKERY - Website Baker shop module
Re: New Module "OneForAll"
« Reply #74 on: January 10, 2016, 10:04:46 AM »
Hi Roych

Thank's for the login details. I have installed the cwsoft-addon-file-editor to get better access to the module files and more control of what's going on.

Why didn't you tell me that you have altered the OneForAll module files, in fact the the mysql query? If you spoil a module please do not ask for help in the forum. This is very annoying and I am pretty upset.

Regards Christoph