Osclass forums

Development => Plugins => Topic started by: Web-Media on July 06, 2015, 11:50:09 pm

Title: [Plugin]Lorem Items
Post by: Web-Media on July 06, 2015, 11:50:09 pm
Hi Osclass users .
https://market.osclass.org/plugins/miscellaneous/lorem-items-pro_882
How many items do you need ? 100 ? 1000 ? 100 000?
Need some items to fill up an empty theme  ? Wanna do some tests on your new (empty) website? Adding items manually can be really time consuming, the main reasons this plugin was create was to speed up this process.
This plugin will insert items {random [ lorem (title,description)],images,price,country,region,city, user-contact email ,username)}into existing categories .
Keeps track of inserted lorem items,so can be  deleted after few clicks .
Rewritten from scratch !
Custom text ,
Custom Title,
Custom User first name ,
Custom User last name ,
Number of images . 
Upload Images per category .
Handle osclass Custom Fields
Can handle  required fields  from plugins  !!! ( Admin can define them ) .
Item Location .

Title: Re: [Plugin]Dummy Items
Post by: pixellegolas on July 07, 2015, 03:30:17 pm
Sound pretty good. Can we add images?
Title: Re: [Plugin]Dummy Items
Post by: Web-Media on July 07, 2015, 04:47:16 pm
Yes .
There is 6 default images (next version admin can upload default images & more options )
The plugin will choose random 1-3 images (from 6).
You can replace default images with your own . (names,file extension must be kept )
Code: [Select]
1.png 2.png 3.png 4.png 5.png 6.png
Title: Re: [Plugin]Dummy Items
Post by: Web-Media on July 07, 2015, 05:04:12 pm
the content of  images folder .
upload the pictures OR put your own  png images (1,2,3,4,5,6) small ones (optimized for web )  for faster uploads
Title: Re: [Plugin]Dummy Items
Post by: Web-Media on July 07, 2015, 05:09:40 pm
This is the results from search page
Title: Re: [Plugin]Dummy Items
Post by: Web-Media on July 07, 2015, 05:12:51 pm
Item page
Title: Re: [Plugin]Dummy Items
Post by: Web-Media on July 08, 2015, 05:30:41 pm
 Features in  Next plugin version :
  What do you wanna see   in next version ?                       
Title: Re: [Plugin]Dummy Items
Post by: Sunkal on July 16, 2015, 05:41:15 pm
Features in  Next plugin version :
  • Insert your own text
  • Choose country
  • Choose category
  • Upload own images
  What do you wanna see   in next version ?                       

its very god but we need zip code for this plugin.can you make this with zip code please
Title: Re: [Plugin]Lorem Items
Post by: dev101 on July 21, 2015, 03:10:12 pm
Hi Web-Media,
sorry for late reply, thanks for this plugin, it is very useful.

There are 2 small issues noticed, but not a big deal really: I have noticed that required custom fields will prevent items to be inserted. Also, not sure why on one of my setups it does not properly detect a country (it "detects" something, but it is blank). Didn't have time to look code itself.

Thanks again,
Regards
Title: Re: [Plugin]Lorem Items
Post by: Hussard (Madhouse) on July 22, 2015, 10:01:35 am
Really clever plugin!

Would be nice to be able to fill custom plugin data (the same in every ads).
Can we create items for registered users too?
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on July 22, 2015, 01:14:46 pm
Hy there  dev101,Hussard  thanks for feedback.
Regarding issues :

a.
Code: [Select]
Custom fields will prevent items to be inserted. Indeed ,plugin does not check for "meta" param  (in this version of the plugin ) .
Problem is required fields from various plugins .
 This fields  are  added by hooks and processed  by each plugin internally .
 Did any of you imagine a way to gather all fields for item post form in a single entry point ?
 lets have a look into  custom attributes plugin
 
Code: [Select]
public function pre_item_post() {
$fields = Params::getParam('fields');
if (!empty($fields) && is_array($fields)) {
foreach ($fields as $id) {
$field = Attributes::newInstance()->getField($id);
$type = $field['s_type'];
$name = 'field_' . $id;
$value = Params::getParam($name);
if ($type == 'checkbox' && empty($value)) {
$value = 'unchecked';
}
Session::newInstance()->_setForm($name, $value);
Session::newInstance()->_keepForm($name);
}
}
}

maybe some  osclass core changes will help us gathering all fields into single entry point .
Code: [Select]
Session::newInstance()->_setItemForm($id_item ,$name, $value,$required);or something similar to check all item fields in 1 place ,required or not
Workarround : drop ItemAction and do the validation inside the  lorem plugin . This will  bypass required fields  and insert Item with no custom required fields .
b.
Code: [Select]
Would be nice to be able to fill custom plugin data
same as above. how do we gather  all item fields related with the procesed item  ?
  from
Code: [Select]
Session::newInstance()->_keepForm($name); ?
from osc_run_hook('post_item'); ? (Item controller )
from ItemActions ?
Code: [Select]
osc_run_hook('pre_item_add', $aItem); ?
how do we validate those fields?
We can add some  optional fields  where admin can add some custom fields  name and  then look for them ?
You are programers , you can look inside other plugins,etc, but there are admins that do not know what to look and where  inside plugins .
That's my  ideas  at 11.24 with no coffee  at breakfast :)
c.
Code: [Select]
Can we create items for registered users too?
I'll include this option in next plugin versions .
Admin to choose between registered,Lorem users.
.............................................................................
Plugin is on github ,so let's improve it .
Some ideas  will push us forward !  ;)

Thanks !
Title: Re: [Plugin]Lorem Items
Post by: dev101 on July 22, 2015, 07:08:06 pm
Hi Web-Media,

No, I haven't thought of a way to do this, and the issue is at least for internal fields that you have to scan entire meta table and get required ones and all available ones from a given (sub)category, which will without a doubt influence the test itself. Unless, you perform this before the timer mark, and later just reuse data. But, it is not a big deal, it may influence accuracy by 2-3% at the most (if there are a lot of ones). Also, there are no ajax requests simulation either (for fields and locations), which also contribute to some amount in the final time. But, overall, it gives you a very good rough estimate, considerable amount of time goes to image processing anyway.

P.S.
I've made a small donation, not much, but for start...

Regards,
dev101
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on July 22, 2015, 09:20:24 pm
Thanks dev101 .
Internal  osclass custom fields can be solved .
Timing is not an issue . User can  choose smaller amount of items or limit number of max items at 10 000. On average shared hosting should insert 10 000 items in 7200 sec (with images) .
More problematic are  required fields added by other plugins  into  item post  hooks.
How do we gather  all that fields ?
Title: Re: [Plugin]Lorem Items
Post by: dev101 on July 22, 2015, 09:25:48 pm
Basic idea:
Quote
if plugin installed > yes > build profile: scan its tables + check required fields

and from there you can figure what type of data is expected (string, number) and generate one. There are only few attributes plugins there, so it should not be hard to cover them all. Again, seems like a lot of trouble for something that will not add much to accuracy, but it can be done.

P.S.
Also, the main reason I am against this is that it will render cross-examination and comparison of the results unusable/questionable, because different setups and configurations will affect generated benchmark results.

Regards
Title: Re: [Plugin]Lorem Items
Post by: frosticek on July 22, 2015, 11:49:51 pm
@Web-Media
Nice one, for images I think it is not hard to do this:
- let's have 500 custom/sample/random images in img folder
- when lorem listing is created, random image is created

It is easy to get 1000 random images from anywhere, then lorem listings will look much universal :)
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on July 23, 2015, 03:02:51 am
@frosticek
My thoughts is :
 Admin can put his own photos  in admin images folder by ftp , plugin upload form

  plugin will scan admin images folder
    if no photos
     use default photos
Title: Re: [Plugin]Lorem Items
Post by: dev101 on July 23, 2015, 03:00:16 pm
Just a reminder that for benchmark consistency and results cross-comparison it is essential to use default supplied images.

Regards
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on July 23, 2015, 08:55:33 pm
Solved :
Admin can upload his own images .
 On create Lorem items he can choose between his images or default images
Choose between users 
   options - Use Random existent registered users
                - One Existent user  for all Items
                - New random Users
                - Create one new for all Items
     
Update available soon on github.
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on July 23, 2015, 09:19:22 pm
@dev101
when admin upload images , all images are resized to 900x600 . (like default images).
The only difference is a directory scan for *.{jpg,png,gif} when he choose to use his own images .
 
Title: Re: [Plugin]Lorem Items
Post by: dev101 on July 23, 2015, 09:31:59 pm
Well, it is different now with pre-upload and resize from admin before test, assuming same geometry.
Title: Re: [Plugin]Lorem Items
Post by: fog on September 01, 2015, 11:16:32 pm
Hi @media-web,

How you can install it normally on your localhost without errors?

I had these errors in a fresh osclass installation without any other plugin, in osclass latest version:

The plugin generated 3408 characters of unexpected output during the installation. Output: "

Warning: file_get_contents(C:/wamp/www/UPGRADE/oc-content/plugins/lorem/index.php) [function.file-get-contents]: failed to open stream: No such file or directory in C:\wamp\www\UPGRADE\oc-includes\osclass\classes\Plugins.php on line 335

I installed the plugin manually like the others, I think. You don't need a subfolder for all content files, or I missed something I don't know.

I cannot do anything on admin part because this errors generated during the installation.

I want test it, so I ask you if I need some trick, or something.

Thank you
Regards
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on September 02, 2015, 10:59:42 am
Hi  @fog .     
I'll test it again . (no errors in my installs) .
I'm working  on a new version  .
Compatible with Osclass custom fields && Custom Attributes plugin .

 
Title: Re: [Plugin]Lorem Items
Post by: fog on September 02, 2015, 02:46:36 pm
Hi @Web-media,
Thanks. Can you zip your plugin of your installation and send me to my email, or upload here?

I download twice on github, but the same problem happens to during installation.

Thank you  :)
Regards
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on September 02, 2015, 10:45:22 pm
Plugin works fine . just downloaded , and  install with no errors .See Attachment .(just some notices on Insert item page )
Code: [Select]
PHP Notice:  Undefined index: pk_c_code  on ... items.php on line 58how do you upload  the plugin  ?
Cannot be uploaded zip what you download  from github .
 You have to unzip first .
    Upload lorem folder into plugins "directory" OR zip again lorem folder  and upload  by osclass  interface .
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on September 02, 2015, 10:51:44 pm
Line 58 should  items.php should  be
Code: [Select]
$option_country .= "<option  value=" .$countries[0]['pk_c_code'].">" . $countries[0]['s_name'] . "</option>";
Title: Re: [Plugin]Lorem Items
Post by: fog on September 03, 2015, 05:39:50 am
Hi @web-media,

Sorry, I mistake the name of the zip, with the name of the plugin (is not the same).  ???

I moved all content files for the same name of the zip, when I needed move it to the name of the folder plugin: "lorem".

Your next version need be zipped with lorem name for it be installed by admin.

Now all is correct for me in manual installation without errors.  :)

Thank you for your support
Regards
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on September 03, 2015, 11:25:48 pm
Hope next plugin version  will be hosted  into the  osclass market
Title: Re: [Plugin]Lorem Items
Post by: Aficionado on September 03, 2015, 11:36:09 pm
Hope next plugin version  will be hosted  into the  osclass market

We will be very old by then (when approved i mean) ...

 :(
Title: Re: [Plugin]Lorem Items
Post by: fog on September 04, 2015, 05:55:06 am
Yep, maybe one or two days for reviewed on osclass team (irony). :D

I have some suggestions if you wish think about this:

1 - Set the number of premium items

2 - Option if admin don't need empty categories:
Splitting the total, for equal number of items per category.
Splitting the total items, for equal number of regions.

3 - Option if the admin need test ads with different publish dates:
So no expire on same date with a random range ;)

Love this plugin, I don't need lose again more time with ads manually, for test some themes or new codes for test in search results per example. Or for test some payment plugin with expiry dates of ads, and other many things.

It just need the new resources for certain moments, if possible, and it need be controlled by admin.
It save a lot of time  :)

Thank you very much!
Regards
Title: Re: [Plugin]Dummy Items
Post by: Emmanuel on April 25, 2016, 12:08:01 pm
  What do you wanna see   in next version ?                       

custom fields getting populated as well

simple textarea with id/slug/names of custom fields followed by enum of random values to use
Title: Re: [Plugin]Lorem Items
Post by: Emmanuel on April 25, 2016, 12:08:58 pm
Hope next plugin version  will be hosted  into the  osclass market

in the meantime, can we fork you repo or setup one somewhere to share?
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on May 03, 2016, 01:35:30 pm
Sure . as long it stays free plugin you can do whatever you wish .
Title: Re: [Plugin]Dummy Items
Post by: osCanyon on June 01, 2016, 10:28:32 pm
Nice Feature :)
saves work, Thank you!!

on install and 1st use, no country was shown in dropdown?, so I added a small country and tried again, now I see both countries and the choice of "Random"
I decided to add more images to choose from, they are all png and none larger than the sample images, I renamed them(my new images) with numbers  starting at 7.png, 8.png, and so on, uploaded them to lorem/images .
I tried again to add 10 more items(different category this time) and most came with no picture attached, is it set at the max of 6 images in the code?, or should have the random been selected from all of them in the image folder of lorem?

PS I think to be able to input your own text and upload more images(from admin) would be a nice idea :)
Osclass v3.6.1

the content of  images folder .
upload the pictures OR put your own  png images (1,2,3,4,5,6) small ones (optimized for web )  for faster uploads
Title: Re: [Plugin]Lorem Items
Post by: osCanyon on June 02, 2016, 02:49:54 am
so I found the array and changed it to include up to 35 :)
Code: [Select]
if (is_numeric($img)) {
            $images = array(
                '1.png',
                '2.png',
                '3.png',
                '4.png',
                '5.png',
                '6.png',
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on June 02, 2016, 05:50:13 pm
Hy all  !
Solved :
I'll release  1.0.2 version next week .
 As for  the custom fields i'm thinking   for version 1.0.3 .
Custom Attributes and  osclass default custom fields  will be supported

Title: Re: [Plugin]Lorem Items
Post by: fosg2000 on June 03, 2016, 06:25:20 pm
nice, addition...

installed with no problems, but can't see any "new ad"  inserted, in the front side, !?

also i can tell that "are there" because the item count on categories show it

i can see it the the back-end, with no problems.

THEME: BOXER

http://www.toyenmala.com/
Title: Re: [Plugin]Lorem Items
Post by: osCanyon on June 05, 2016, 02:53:02 am
Thank You So much Web-Media
shall I just keep an eye on github? :o
this is the "cats meow" lol as they say  8)

Hy all  !
Solved :
  • Upload,delete images from admin  is solved 
  • custom text from admin .
  • custom description and title lenght
  • custom user (random  registered ,random default or admin specified ) 
I'll release  1.0.2 version next week .
 As for  the custom fields i'm thinking   for version 1.0.3 .
Custom Attributes and  osclass default custom fields  will be supported
Title: Re: [Plugin]Lorem Items
Post by: osCanyon on June 07, 2016, 02:56:36 pm
@Web-Media
I sent you an email to your yahoo address but not sure you still use that one.
this plugin saves a lot of time and I have an idea I wanted to discuss with you..in private  ;D
Title: Re: [Plugin]Lorem Items
Post by: fosg2000 on June 11, 2016, 05:09:19 pm
Works !

the only issue now is when click the drop down menu for "country" is empty

thanks
Title: Re: [Plugin]Lorem Items
Post by: Abhi on June 14, 2016, 12:02:34 am
Works !

the only issue now is when click the drop down menu for "country" is empty

thanks
hi i checked code
in items.php
for case 0 and default  case works fine

for case 1 i modified to this

 case 1:
       
        $option_country .= "<option  value=" .$countries[0]['pk_c_code'].">" . $countries[0]['s_name'] . "</option>";
        break;

and its working when there is only single country
Title: Re: [Plugin]Lorem Items
Post by: fosg2000 on June 14, 2016, 01:46:42 am
thanks for reply, but is not working for me


here is my actual line 49 to line 74

<?php
    $option_country = '';
   $option_country .= "<option  value=\"\">" . 'Select country' . "</option>";
    $countries = osc_get_countries();
   
    switch (count($countries)) {
    case 0:
        $country_message = '<pre>You have no country installed.Install at least 1 country or insert Lorem items with no location (Country,Region,City).</pre> ';
        break;
    case 1:
        $option_country .= "<option  value=" .$countries['pk_c_code'].">" . $countries['s_name'] . "</option>";
        break;
    default:
        foreach ($countries as $country) {
    $option_country .=  "<option value=".$country['pk_c_code'].">".$country['s_name']."</option>";
   }
 $option_country .= "<option  value=\"1\">" . 'Use Random Country' . "</option>";
        break;
    }

if(isset($country_message)){
    echo $country_message;
}else{

echo "<select name =\"loremCountry\">$option_country</select>\n";
}
?>
Title: Re: [Plugin]Lorem Items WITH SAMPLE FLAG
Post by: Emmanuel on June 14, 2016, 06:55:17 am
Hi All,

New idea just pop'ing now is :


Anybody has already seen either such a plugin or this 'hack' somewhere around?

imho, with not-so-lorem ads, would please Google and help to boot up new website
(not-so-lorem meaning "real" fake ads if i may say  ;) )

Any idea or comment please

Best regards
Eman
Title: Re: [Plugin]Lorem Items
Post by: Abhi on June 14, 2016, 09:10:23 am
thanks for reply, but is not working for me


here is my actual line 49 to line 74

<?php
    $option_country = '';
   $option_country .= "<option  value=\"\">" . 'Select country' . "</option>";
    $countries = osc_get_countries();
   
    switch (count($countries)) {
    case 0:
        $country_message = '<pre>You have no country installed.Install at least 1 country or insert Lorem items with no location (Country,Region,City).</pre> ';
        break;
    case 1:
        $option_country .= "<option  value=" .$countries['pk_c_code'].">" . $countries['s_name'] . "</option>";
        break;
    default:
        foreach ($countries as $country) {
    $option_country .=  "<option value=".$country['pk_c_code'].">".$country['s_name']."</option>";
   }
 $option_country .= "<option  value=\"1\">" . 'Use Random Country' . "</option>";
        break;
    }

if(isset($country_message)){
    echo $country_message;
}else{

echo "<select name =\"loremCountry\">$option_country</select>\n";
}
?>

Check the screenshots i copied your code and run it check withzero image
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on June 14, 2016, 10:10:29 am
Hy Abbi143u11 .
What country do you have installed ?
Osc_get_countries is a osclass function that should return countries .
Title: Re: [Plugin]Lorem Items
Post by: Abhi on June 14, 2016, 11:36:57 am
i had installed one country India

the code was not working for one country so in case1 i added 0

and when there are multiple countries the default case works fine
Title: Re: [Plugin]Lorem Items
Post by: fosg2000 on June 14, 2016, 05:42:30 pm
works, thanks  8)
Title: Re: [Plugin]Lorem Items
Post by: Abhi on June 14, 2016, 09:28:19 pm
@webmedia

is there any way you can guide or help me in integration of your plugin with api where I get title price description and real url can you please help me thanks in advance
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on June 15, 2016, 06:39:33 pm
Sorry,I'm kinda bussy ,rewriting from scratch lorem,benchmark  , and few more  plugings .
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on January 06, 2017, 02:41:10 am
Hi guys .! 
Rewritten from scratch . Check images on first post ! 
Solved custom fields  and plugins required  fields .
Title: Re: [Plugin]Lorem Items
Post by: Aficionado on April 24, 2017, 08:08:03 pm
Hi guys .! 
Rewritten from scratch . Check images on first post ! 
Solved custom fields  and plugins required  fields .

I'm blind or something ? Where is the link for the plugin ?

Thanks
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on April 24, 2017, 09:31:09 pm
Link Removed. I've rewrited the plugin to suport osclass custom fields and custom fields from any plugin (cars,realestate...etc). Will be  2 versions. Free one (without custom fields) and paid one  ( with custom fields) .
Don't know the release date  (soon y hope)

Title: Re: [Plugin]Lorem Items
Post by: Web-Media on May 02, 2017, 12:57:31 am
The Plugin is ready .
 Just some small tests  with  2-3 plugins enabled and  some  required osclass fields to fully test   it  .
Title: Re: [Plugin]Lorem Items
Post by: Liath on May 02, 2017, 01:22:15 am
looks great :)
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on May 15, 2017, 01:56:00 pm
Thanks .
Uploaded to the market  will  be  available soon.
 Free version also
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on May 30, 2017, 10:08:08 pm
https://market.osclass.org/plugins/miscellaneous/lorem-items-pro_882
 The free one available soon .!
Title: Re: [Plugin]Lorem Items
Post by: officeland on April 02, 2019, 04:37:27 pm
Hello!! where i can find the free version?
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on April 02, 2019, 08:02:55 pm
 Hy there . There will be available in 1 month .. aprox .
Title: Re: [Plugin]Lorem Items
Post by: officeland on April 04, 2019, 12:18:46 am
may i ask you....
I want to add some real estate ads. the reason is that i want the website to have some content.....
how many different users can support the pro? i mean on how many different accounts will the ads be credited?

what about the custom fields i have from multilanguage attributes plugin? it is supported?

do you have any video or any example page to understand if this is good for me?

The demo is not working.....

Forgot to mention that my language is Greek.
Title: Re: [Plugin]Lorem Items
Post by: Web-Media on April 04, 2019, 01:03:00 am
 Hy there officeland
There is  49  names and 13 surnames (637) valid user  and Email is generated using ($name.$surname@yahoo.com)

 Any Osclass  custom field created on admin dashboard and any plugin custom  field  is supported  by adding identifier and some random default values .
To replicate any  plugin custom  field it's just the same as creation  of osclass custom fields  + adding default values to choose from
Dropdown, Url ,Radio and Checkboxes exploded by comma (,) and will produce a single random value ,Text  and Textarea by space and will return multiple values , date,dateinterval,
Only one language   (default language ) is supported , multilanguage is not the purpose of the plugin .
Demo is not working , main domain is expired , i was thinking of choosing another domain name ..
For any customization contact me  at 4oscmad2@gmail.com