Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 11790
Latest: ButtKoWitz
New This Month: 3
New This Week: 0
New Today: 0
Stats
Total Posts: 41408
Total Topics: 7255
Most Online Today: 80
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 71
Total: 71

Author Topic: Completed and Expired Listings  (Read 14653 times)

0 Members and 1 Guest are viewing this topic.

Offline Riley

  • Bad Emails DO NOT EMAIL
  • Full Member
  • *
  • Posts: 114
    • View Profile
Completed and Expired Listings
« on: November 18, 2008, 07:17:00 pm »
Is there a way to add the Completed/Sold  and Expired listings to the listing members account?

Can the following be added and have it so that the listings automatically revert to the below places when they are completed/sold or expired. That way it makes the listing members responsible for :

1- Deleting their own listings if expired or re listing them.

2- It lets them have access to completed listings in case of a problem with the buyer, etc. They can use the completed listing for references such as item description, etc.

Ex:
On the Classifieds there already is My Listings

Add:
My Completed/Sold listings
My Expired Listings

Maybe even set it up with a warning that all of the Saved and Completed listings will expire automatically in 7 days. Then have a setting that will delete these in 7 days.

This does a number of things:
1- It frees the Admin up to run the whole forum/classifieds and whatever they may have instead of making them responsible for what could be possibly hundreds and hundreds of listings to always have to monitor

2- Puts the members more in charge of their own listings(the way it works on Ebay)

3- Keeps the Classifieds cleaned up and more under control

Thanks alot!!
« Last Edit: November 24, 2008, 02:11:42 pm by Riley »

Offline vkot

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Completed and Expired Listings
« Reply #1 on: November 19, 2008, 01:59:05 am »
Add:
My Completed/Sold listings
My Expired Listings

There's no need to have different links. All listings can be shown on the same page.

This shouldn't be difficult, just add 2 more queries like the following one (copy-paste from classifieds.template.php), adding " WHERE listingstatus=......"

Code: [Select]
$dbresult = db_query("
SELECT
i.ID_LISTING, i.currency, i.title, c.ID_CAT, c.title catname, i.commenttotal, i.totalbids
FROM {$db_prefix}class_listing AS i
LEFT JOIN {$db_prefix}class_cat AS c ON (c.ID_CAT = i.ID_CAT)
WHERE i.ID_MEMBER = $ID_MEMBER ORDER BY i.ID_LISTING DESC  LIMIT $context[start]," . $modSettings['class_set_listings_per_page'], __FILE__, __LINE__);

Offline Riley

  • Bad Emails DO NOT EMAIL
  • Full Member
  • *
  • Posts: 114
    • View Profile
Re: Completed and Expired Listings
« Reply #2 on: November 19, 2008, 09:21:58 am »
Thanks so much for the response.

I am not savvy enough yet on coding. Gotten alot better but not quite there yet lol!!

Could someone please help me with this coding needed and where I put it exactly. I certainly would appreciate it.

Once this is coded am I right in assuming that all of the listings whether expired or completed will now be listed under the members listings for them to handle?  Does this then remove these listings from the Classifieds themselves?

I just want to make sure this does, as it saves alot of time for the Admin and keeps the boards cleaned up.

Thanks again!!!!!!

Offline Riley

  • Bad Emails DO NOT EMAIL
  • Full Member
  • *
  • Posts: 114
    • View Profile
Re: Completed and Expired Listings
« Reply #3 on: November 22, 2008, 03:47:57 am »
Any help on this would be appreciated.

Thanks in advance

Offline Riley

  • Bad Emails DO NOT EMAIL
  • Full Member
  • *
  • Posts: 114
    • View Profile
Re: Completed and Expired Listings
« Reply #4 on: November 24, 2008, 09:29:00 am »
Is it possible to get someone to help me with this. I would like to get this added to my new forum.

Thanks!!

Offline Riley

  • Bad Emails DO NOT EMAIL
  • Full Member
  • *
  • Posts: 114
    • View Profile
Re: Completed and Expired Listings
« Reply #5 on: November 24, 2008, 10:36:11 pm »
This is terrible!! Why is it taking so long to get support on a bought package?

Can I please get some help on this Classified Mod Please!!!!!!!

I don't understand what I was told I can do and I need help.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15662
    • View Profile
Re: Completed and Expired Listings
« Reply #6 on: November 25, 2008, 09:04:26 pm »
This is a one person operation where I work full time any time after that I can give for support. That code is not my code so I can support that user submitted modification.

Feature requests have a chance to make in the next version but they do take time weeks to months.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline vkot

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Completed and Expired Listings
« Reply #7 on: November 29, 2008, 02:11:10 am »
OK, I spent some time and made some code for this. The following hack will show open/closed/completed listings in the user's "my listings" page. If there are no listings of one or more of the types open/closed/completed, it omits the relevant table header too.

Note: I don't know what happens when there are more pages of listings, of one or more of these types, and you click on another page. (Not tested)

Use at your own risk!

In classifieds.template.php change:
Code: [Select]
// Get Total Pages
$dbresult = db_query("
SELECT
COUNT(*) AS total
FROM {$db_prefix}class_listing
WHERE ID_MEMBER = $ID_MEMBER", __FILE__, __LINE__);
$row = mysql_fetch_assoc($dbresult);
$total = $row['total'];
mysql_free_result($dbresult);

echo '<table cellspacing="0" cellpadding="10" border="0" align="center" class="tborder">
<tr class="titlebg">
<td><b>',$txt['class_txt_listingname'],'</b></td>
<td><b>', $txt['class_text_classname'],'</b></td>
<td><b>',$txt['class_text_totalbids'], '</b></td>
<td><b>',$txt['class_text_comments'],'</b></td>
</tr>
';
 $style_class = "windowbg";
 
$dbresult = db_query("
SELECT
i.ID_LISTING, i.currency, i.title, c.ID_CAT, c.title catname, i.commenttotal, i.totalbids
FROM {$db_prefix}class_listing AS i
LEFT JOIN {$db_prefix}class_cat AS c ON (c.ID_CAT = i.ID_CAT)
WHERE i.ID_MEMBER = $ID_MEMBER ORDER BY i.ID_LISTING DESC  LIMIT $context[start]," . $modSettings['class_set_listings_per_page'], __FILE__, __LINE__);
 
while ($row = mysql_fetch_assoc($dbresult))
{
echo '<tr class="'.  $style_class . '">';
echo '<td><a href="',$scripturl, '?action=classifieds;sa=view;id=', $row['ID_LISTING'], '">', $row['title'],'</a></td>';
echo '<td><a href="',$scripturl, '?action=classifieds;cat=', $row['ID_CAT'], '">' . $row['catname'] . '</a></td>';
echo '<td>', $row['totalbids'], '</td>';
echo '<td>', $row['commenttotal'], '</td>';
echo '</tr>';

if ($style_class == 'windowbg')
$style_class = 'windowbg2';
else
$style_class = 'windowbg';

}

mysql_free_result($dbresult);


if ($total > 0)
{
echo '<tr class="titlebg">
<td align="left" colspan="4">
' . $txt['class_text_pages'];


$context['page_index'] = constructPageIndex($scripturl . '?action=classifieds;sa=mylistings',$_REQUEST['start'], $total, $modSettings['class_set_listings_per_page']);

echo $context['page_index'];

echo '
</td>
</tr>';
}

to:
Code: [Select]
echo '<table cellspacing="0" cellpadding="10" border="0" align="center" class="tborder">';
for ($lstatus=0;$lstatus<=2;$lstatus++)
{
// Get Total Pages
$dbresult = db_query("
SELECT
COUNT(*) AS total
FROM {$db_prefix}class_listing
WHERE ID_MEMBER = $ID_MEMBER AND listingstatus = $lstatus", __FILE__, __LINE__);
$row = mysql_fetch_assoc($dbresult);
$total = $row['total'];
mysql_free_result($dbresult);

 if ($total)
 {
echo '<tr class="titlebg"><td colspan="4" align="center"></i>';
switch ($lstatus) {
case 0: echo $txt['class_status_open']; break;
case 1: echo $txt['class_status_closed']; break;
case 2: echo $txt['class_status_completed']; break;
}
echo '</i></td></tr>

<tr class="titlebg">
<td><b>',$txt['class_txt_listingname'],'</b></td>
<td><b>', $txt['class_text_classname'],'</b></td>
<td><b>',$txt['class_text_totalbids'], '</b></td>
<td><b>',$txt['class_text_comments'],'</b></td>
</tr>
';
 $style_class = "windowbg";
 
$dbresult = db_query("
SELECT
i.ID_LISTING, i.currency, i.title, c.ID_CAT, c.title catname, i.commenttotal, i.totalbids, i.listingstatus
FROM {$db_prefix}class_listing AS i
LEFT JOIN {$db_prefix}class_cat AS c ON (c.ID_CAT = i.ID_CAT)
WHERE i.ID_MEMBER = $ID_MEMBER AND i.listingstatus = $lstatus ORDER BY i.ID_LISTING DESC  LIMIT $context[start]," . $modSettings['class_set_listings_per_page'], __FILE__, __LINE__);
 
while ($row = mysql_fetch_assoc($dbresult))
{
echo '<tr class="'.  $style_class . '">';
echo '<td><a href="',$scripturl, '?action=classifieds;sa=view;id=', $row['ID_LISTING'], '">', $row['title'],'</a></td>';
echo '<td><a href="',$scripturl, '?action=classifieds;cat=', $row['ID_CAT'], '">' . $row['catname'] . '</a></td>';
echo '<td>', $row['totalbids'], '</td>';
echo '<td>', $row['commenttotal'], '</td>';
echo '</tr>';

if ($style_class == 'windowbg')
$style_class = 'windowbg2';
else
$style_class = 'windowbg';

}

mysql_free_result($dbresult);


if ($total > 0)
{
echo '<tr class="titlebg">
<td align="left" colspan="4">
' . $txt['class_text_pages'];


$context['page_index'] = constructPageIndex($scripturl . '?action=classifieds;sa=mylistings',$_REQUEST['start'], $total, $modSettings['class_set_listings_per_page']);

echo $context['page_index'];

echo '
</td>
</tr>';
}
 }
}

« Last Edit: January 05, 2009, 12:16:09 am by vkot »

Offline Riley

  • Bad Emails DO NOT EMAIL
  • Full Member
  • *
  • Posts: 114
    • View Profile
Re: Completed and Expired Listings
« Reply #8 on: December 31, 2008, 09:55:46 pm »
Hi

Just thought I would ask if there is anyway this could be added to a future upgrade.

I have listings just sitting in the Classifieds that have closed. I don't want to move them as some members get upset when you mess with their stuff and we certainly don't want any problems lol

It would be so nice if closed and completed listings would get moved to the members Closed/Completed tabs (Like My Listings) and it would remove them from the boards and clean them up. It gets too much for the Admin to have to keep track of all of this lol!!

Thanks!!

Offline vkot

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Completed and Expired Listings
« Reply #9 on: January 05, 2009, 12:28:54 am »
Riley,
I don't know why my code didn't work for you. I used it on my site and seems OK. Do you get any errors or strange output?


Now, about the closed/completed listings, I think they should be moved automatically to the recycle bin after a specified period of time.

Offline Riley

  • Bad Emails DO NOT EMAIL
  • Full Member
  • *
  • Posts: 114
    • View Profile
Re: Completed and Expired Listings
« Reply #10 on: January 05, 2009, 12:42:30 am »
Hi there!!!  :)

I added the code and I did a test listing and then ended it. I went to "My Listings and it showed it in the list but there was nothing that had Closed, etc. Am I doing this wrong lol

I want it to be similar to eBay where a member can go to a tab, Closed, Sold, etc and then be able to see all their listings there and have them as the ones who relist or delete the listing.

I am having problems as the members want to do do this themselves and don't like the idea of it going to a deleted bin and not having control over their own listings. To them they see their listings gone and then get a little upset with the Admins. If they sell something they want it to be in a sold tab where they can go back to it if there is ever a problem with the sale then delete it.

Not to mention it would make the Admins life alot easier not having to answer alot of questions as to why they can't have their listings automatically move to their tabs for them to manage.

I hope this makes sense lol


Offline vkot

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Completed and Expired Listings
« Reply #11 on: January 05, 2009, 01:14:57 am »
I added the code and I did a test listing and then ended it. I went to "My Listings and it showed it in the list but there was nothing that had Closed, etc. Am I doing this wrong lol

You don't get any table headers? Strange. I used smf classifieds' strings. Try changing this:
Code: [Select]
case 0: echo $txt['class_status_open']; break;
case 1: echo $txt['class_status_closed']; break;
case 2: echo $txt['class_status_completed']; break;
to this:
Code: [Select]
case 0: echo 'Open'; break;
case 1: echo 'Closed'; break;
case 2: echo 'Completed'; break;

I want it to be similar to eBay where a member can go to a tab, Closed, Sold, etc and then be able to see all their listings there and have them as the ones who relist or delete the listing.

So, you want the completed/expired listings to show on the owner's listings page (My listings) but not on the category's listings (not in public view), right?  This would be nice.

SMFHacks,
I think that a simple check before the lines that show the listings in public, should do the trick... For example:
Code: [Select]
if ($row['listingstatus'] == 0)
echo '<td><a href="', $scripturl, '?action=classifieds;sa=view;id=', $row['ID_LISTING'], '">', ($row['featuredlisting'] == 0 ? $row['title'] : '<b>' . $row['title'] . '</b>'), '</a></td>';

This should be an option, because some admins would like the completed/expired listings to remain in public.

Offline Riley

  • Bad Emails DO NOT EMAIL
  • Full Member
  • *
  • Posts: 114
    • View Profile
Re: Completed and Expired Listings
« Reply #12 on: January 05, 2009, 01:27:54 am »
Great!!  I really appreciate all of your help. I just love this and am trying to get it just right for everyone!! lol

No I didn't get any headers showing at all.I will add the codes and see what happens and let you know.

Yes it would be nice for a members listings to be moved to the proper tab: Completed, Sold, etc., For the members to see and do with what they want and out of public view.This way it gives the members control on their listings and frees up the boards so they are not full of sold and completed listings.

It would be nice if folks could still search for completed listings but not have them all over the main boards.

Offline Riley

  • Bad Emails DO NOT EMAIL
  • Full Member
  • *
  • Posts: 114
    • View Profile
Re: Completed and Expired Listings
« Reply #13 on: January 06, 2009, 10:45:26 am »
Okay I have the Open, Closed, Completed showing and working!! WooHoo!!

Thanks so much.  :)

Now if we can get them to move out of the main boards and to each members My Listings page that would be awesome!!!

Classifieds rocks!!!!
« Last Edit: January 18, 2009, 12:10:04 am by Riley »

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
4695 Views
Last post December 31, 2008, 06:03:51 pm
by SMFHacks
3 Replies
6228 Views
Last post November 25, 2013, 02:38:51 pm
by vkot
9 Replies
4815 Views
Last post December 19, 2011, 12:41:19 pm
by SMFHacks
1 Replies
2366 Views
Last post September 16, 2012, 07:57:23 pm
by SMFHacks
1 Replies
3305 Views
Last post March 05, 2014, 07:36:36 am
by SMFHacks

+- Recent Topics

Import downloads by mickjav
September 25, 2021, 04:47:13 am

Errors with 5.0.6 version by Hatshepsut
September 24, 2021, 10:21:24 pm

Forum ToolBox by mickjav
September 23, 2021, 03:20:07 pm

Ads Description is running into Ad Location by Shades
September 23, 2021, 09:56:42 am

S3 System For SMF Attachments by SMFHacks
September 21, 2021, 05:46:38 pm

Boards Icon by mickjav
September 18, 2021, 02:13:43 pm

Search Word Limit by SMFHacks
September 17, 2021, 08:41:01 pm

Item not appearing in category by SMFHacks
September 17, 2021, 08:39:45 pm

Undefined index: gallery_ad_seller by Shades
September 17, 2021, 01:23:10 pm

What happens if? by SMFHacks
September 14, 2021, 10:25:07 pm

Powered by EzPortal