Items manger - 0.9-5
- new futures:
Install:
1. copy all files (but functions.php) to /plugins/
a) copy content of functions.php to /theme/theme_name/functions.php
2. make your own custom fields
3. make your own list/table with your custom fields.
4. prepare your own template to print items details.
New things in backend /
- items list have V and P switchers
(V - hide / unhide item)
(P - promo / unpromo item)
- items list shows category of every item
Custom functions:
im_get_list_promoted($items_count) - im using it on index, but should also look nice in sidebar
- im_get_list_promoted(4) - will print 4 (or less) random items that are marked as promoted,
change :
echo '<h3>'.$title.'</h3>';
echo '<a href="'.$url.$data->slug.'">read more</a>';
to everything You like. To call any field use $data->filed_name/custom_field;
im_get_list_for_select()
- makes select-list of all availbe (not hidden) items.
Functions im_get_list_for_select() provide:
<option value="item_slug_name">Item_title</option>
also You can add:
and make form like this
this provides select list with nice working filter.
Still TO DO:
- order of items / and switch between print list by alphabetical or order in list. /
- better way to get images / now if img don't exist this stuppid icon shows - maby default img for items list ?
- integrate with i18n / translations
- support for search,
- support for caching
- support for printing sitemaps / (!! verry important for me now - SEO - need help !!)
- prevent for overwriting if You click new item and make same item name.
- CODE CLEAN ! Its messy.
Code:
fix warnings about ITEMSFILE,
fix stripcslashes problem when subbmit settings
fix double slug name
fix problem with entities
fix warnings when getTheField('field_name') dosn't exist
fix warnings that $items_title wasn't defined.
change img dir to: /data/uploads/items
- new futures:
Code:
Switch Visible - You can hide / unhide product
Switch Promo - You can make product promoted
Select list with all products and filter (in javascript)
section with 3 (or more) random promoted products
list of all items are sorted alphabetical
Install:
1. copy all files (but functions.php) to /plugins/
a) copy content of functions.php to /theme/theme_name/functions.php
2. make your own custom fields
3. make your own list/table with your custom fields.
4. prepare your own template to print items details.
New things in backend /
- items list have V and P switchers
(V - hide / unhide item)
(P - promo / unpromo item)
- items list shows category of every item
Custom functions:
im_get_list_promoted($items_count) - im using it on index, but should also look nice in sidebar
- im_get_list_promoted(4) - will print 4 (or less) random items that are marked as promoted,
change :
echo '<h3>'.$title.'</h3>';
echo '<a href="'.$url.$data->slug.'">read more</a>';
to everything You like. To call any field use $data->filed_name/custom_field;
im_get_list_for_select()
- makes select-list of all availbe (not hidden) items.
Functions im_get_list_for_select() provide:
<option value="item_slug_name">Item_title</option>
also You can add:
Code:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
filtrowanie = new Object();
filtrowanie.selectFilterData = new Object();
filtrowanie.selectFilter = function(selectId, filter) {
var list = document.getElementById(selectId);
if(!filtrowanie.selectFilterData[selectId]) { //take all elements into array
filtrowanie.selectFilterData[selectId] = new Array();
for(var i = 0; i < list.options.length; i++) filtrowanie.selectFilterData[selectId][i] = list.options[i];
}
list.options.length = 0; //clear all elements
for(var i = 0; i < filtrowanie.selectFilterData[selectId].length; i++) { //print all matched elements
var o = filtrowanie.selectFilterData[selectId][i];
if(o.text.toLowerCase().indexOf(filter.toLowerCase()) >= 0) list.add(o, null);
}
}
</script>
Code:
<div class="section">
<input type="text" onkeyup="filtrowanie.selectFilter('select-list', this.value)" />
<FORM action="<?php echo find_url('slug_name_of_item_details_page',null); ?>" method="GET">
<select id="select-list" size="18" name="item">
<?php im_get_list_for_select();?>
</select>
<input type="submit" value="select">
</FORM>
this provides select list with nice working filter.
Still TO DO:
- order of items / and switch between print list by alphabetical or order in list. /
- better way to get images / now if img don't exist this stuppid icon shows - maby default img for items list ?
- integrate with i18n / translations
- support for search,
- support for caching
- support for printing sitemaps / (!! verry important for me now - SEO - need help !!)
- prevent for overwriting if You click new item and make same item name.
- CODE CLEAN ! Its messy.