armed-smoking
 
Exclusive eBooks, Software Solutions, Quality Guaranteed
 
Web NukeBiz
Welcome to NukeBiz · Members
Amazon
show cart or checkout0 items
Cart Value: 0.00

Forums » DragonflyCMS Projects » Storez » [solved] block-Storez_Stores
[solved] block-Storez_Stores
A comprehensive shopping cart solution.
Topic initiation via Bugger.

Post new topic    Reply to topic    Printer Friendly Page     Forum Index »  eCommerce » Storez

View previous topic :: View next topic  
Author Message
Therius
New Poster
New Poster

Offline Offline
Joined: Sep 05, 2009
Posts: 2

PostPosted: Sun Sep 06, 2009 1:04 am
Post subject: [solved] block-Storez_Stores

Hey guys. I noticed that the block populates the list (links) in the order that you create your stores. Is there any way to have it populate alphabetically?

I've been playing with the code but i'm still learning php and can't get it to sort. I've been crawling thru php sort tutorials but it's over my head at this point.

Also I was curious if it were possible to list an item count next to the link.
ex:
Apparel (5)
Beauty (3)

Thanks for any help.


Therius's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/?/5.0.67/5.2.8/9.2.1
Back to top
View user's profile
Phoenix
Chairman
Chairman

Offline Offline
Joined: Mar 18, 2004
Posts: 1457
Location: Netizen
PostPosted: Mon Sep 07, 2009 8:49 am
Post subject: Re: block-Storez_Stores

The simplest solution is to replace the block's code with this, albeit an extra db query:
PHP:
<?php
/***********************************************************************
* StorezPro *
************************************************************************
* $Source: /0cvs/Storez/blocks/block-Storez_Stores.php,v $ *
* $Revision: 1.7 $ *
* $Author: Phoenix $ *
* $Date: 2008/10/02 13:13:48 $ *
***********************************************************************/
if (!defined('CPG_NUKE')) { exit; }

if (!
is_active('Storez')) {
$content = 'ERROR';
return trigger_error('Storez module is inactive', E_USER_WARNING);
}
get_lang('Storez');
global
$prefix, $db;

$content = '';
$result = $db->sql_query("SELECT * FROM {$prefix}_cart_stores
WHERE parentid=0
ORDER BY title ASC"
);
if (
$result) {
while ($row = $db->sql_fetchrow($result, SQL_ASSOC)) {
$content .= '<b>&#8226;</b> <a href="'.getlink('Storez&amp;store_id='.$row['store_id']).'">'.$row['title'].'</a><br />';
}
$db->sql_freeresult($result);
} else {
$content .= _STOREZ_BLOCK_STORES_NOSTORES;
}

_________________
DonationsPro for vBulletin, SMF, MyBB, DragonflyCMS


Phoenix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website ICQ Number Yahoo Messenger Photo Gallery
Therius
New Poster
New Poster

Offline Offline
Joined: Sep 05, 2009
Posts: 2

PostPosted: Mon Sep 07, 2009 10:58 am
Post subject: Re: block-Storez_Stores

Phoenix, thank you. I much appreciate you taking the time to mod the block for me. It works perfectly.


Therius's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/?/5.0.67/5.2.8/9.2.1
Back to top
View user's profile
Display posts from previous:   
Post new topic    Reply to topic    Printer Friendly Page    Forum Index »  eCommerce » Storez
Page 1 of 1
All times are GMT + 9.5 Hours



Jump to:  


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum