vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   End-User Options - Classifieds: Mark Thread as "Sold" (https://vborg.vbsupport.ru/showthread.php?t=260699)

venom2124 03-19-2011 10:00 PM

Classifieds: Mark Thread as "Sold"
 
1 Attachment(s)
If you use this modification, please >> Mark As Installed, and consider Nominate for MOTM and Support Developer << :)


What is this!?

This modification will allow you & your members (based on usergroup permissions) to mark a thread as "Sold". It will add the prefix "SOLD" to the thread title, and if set in the admincp - it will also close the thread. If you run a classified forum for your members this will give you a way to let users add a Sold prefix when the item is gone. Admins and mods can using to make items sold as well.

This is a modification of code provided by Eric.

Current Version
1.2



Sounds cool. How do I install?


1. Extract the zip, you should have the following directories/files:

Code:

   

      /
      |_ install.html
      |_ product-soldthread.xml

      /upload/
      |_ sold.php

          /upload/images/
              /buttons/
              |_ marksold.gif

          /upload/includes/
              /xml/
              |_ bitfield_soldthread.xml

2. Upload: (in the below instructions 'yourforum' would be where you have vBulletin installed)
* /upload/sold.php to /yourforum/sold.php
* /upload/images/buttons/marksold.gif to /yourforum/images/buttons/marksold.gif (upload to each style folder, if you have more than one style)
* /upload/includes/xml/bitfield_soldthread.xml to /yourforum/includes/xml/bitfield_soldthread.xml

3. Import the product, product-soldthreads.xml by going to: AdminCP -> Plugins & Products -> Manage Products -> [Add/Import Product]

4. Make the following template edits to all of your installed styles:

SHOWTHREAD

Find:
HTML Code:


                          <vb:if condition="$show['addpoll']">
                                                <li><a href="poll.php?{vb:raw session.sessionurl}do=newpoll&amp;t={vb:raw threadid}">{vb:rawphrase add_a_poll_to_this_thread}&hellip;</a></li>
                                        </vb:if>

Add after:
HTML Code:


                          <vb:if condition="$show['soldthread']">
                              <li><a href="sold.php?{vb:raw session.sessionurl}do=marksold&amp;t={vb:raw threadid}">{vb:rawphrase soldthread_marksold}&hellip;</a></li>
                          <vb:else />
                              <vb:if condition="$show['soldthread_unsold']">
                              <li><a href="sold.php?{vb:raw session.sessionurl}do=markunsold&amp;t={vb:raw threadid}">{vb:rawphrase soldthread_markunsold}&hellip;</a></li>
                              </vb:if>
                          </vb:if>

5. Set options in AdminCP > Settings > Options > Sold Threads

6. Edit Sold Threads Permissions > Can Mark Threads as Sold for each usergroup.

7. To setup the forums it can be used in, follow these instructions:
  • After installing, go to: Thread Prefixes >> Thread Prefix Manager
  • You'll see: Sold Thread on the left, [Add Prefix] [Edit] [Delete] on the righ
  • Choose Edit.Then you'll see: Use Prefix Set in These Forums, select the forums you want this used in. (Hold the CTRL button to select more than one)
That's it! Enjoy!:D

Upgrade:
  • Reupload files
  • Import product file and select overwrite

Changelog:

V1.0- Initial Release
V1.1- Updated bitfield_soldthread file
V1.2- Fixed permission issue


If you use this modification, please >> Mark As Installed, and consider Nominate for MOTM and Support Developer << :)




NOTE: This mod is marked "unsupported", but I'll try my best (as time permits) to help those who have marked as installed.

BlackJacket 03-20-2011 06:32 PM

Awesome mod! I do have a request though. Could the member who started the thread have the option to mark it as sold as well?

venom2124 03-20-2011 07:17 PM

The member who started the post does have the ability to mark the item as sold already. As long as the permissions are set correctly only a admin or mod and the user can make an item sold or unsold.

I just tested with a normal registered user profile and it allowed me to make a thread I created as sold or unsold, but didn't let me change the status of another members thread.

Hope this clears up the issue if not let me know.

QuickQuestion 03-20-2011 08:55 PM

This is good stuff.

venom2124 03-21-2011 06:28 PM

Yeah being able to see if an item in our classifieds section is already sold before clicking on it makes it really nice for sure.

BadgerDog 03-21-2011 07:41 PM

Interesting ... :)

We already use WTS and WTB and WTT prefixes (Want to Sell, Want to Buy, Want to Trade) in our on-line sales forums.

Will this mod simply replace those existing prefixes with SOLD if the seller (or buyer) thread starter marks his thread as SOLD, or does it place the word SOLD in front of the existing prefixes?

Regards,
Doug

venom2124 03-21-2011 08:03 PM

Yes once the item is sold and the member or mod marks it as sold it will replace the previous prefix with the sold prefix.

I would say take a look at my sight but right now I have the classifieds section invisible to non members.

BadgerDog 03-21-2011 08:18 PM

Quote:

Originally Posted by venom2124 (Post 2175919)
Yes once the item is sold and the member or mod marks it as sold it will replace the previous prefix with the sold prefix.

I would say take a look at my sight but right now I have the classifieds section invisible to non members.

Thanks... appreciate the quick response ... :up:

Excellent idea ...

We operate two separate forums for our members that could use this, so I think I'll try some testing ....

Regards,
Doug

BadgerDog 03-21-2011 08:29 PM

1 Attachment(s)
Installed on vbulletin 4.04 .. :)

I think you have a problem with the bitfield used for UserGroups? (see pic)

As an example, the way you mod appears to our Registered Group under UserGroup settings is only YES/NO... there's no description or title? :confused:

Regards,
Doug

Edit: also missing from Prefix area .. ;)

BadgerDog 03-21-2011 08:49 PM

1 Attachment(s)
Also, just tested using my own Administrator login and attempted to mark an ad as SOLD belonging to another member ....

The Mark as SOLD option appears in the drop down box, but when I click on it, I received a "No Permissions error ...."

Yes, I have the Usergroup box for Admins checked to YES ... ;)

I thought Admins could do this, or have I missed something in the instructions? :confused:

Regards,
Doug

venom2124 03-21-2011 10:27 PM

Quote:

Originally Posted by BadgerDog (Post 2175939)
Also, just tested using my own Administrator login and attempted to mark an ad as SOLD belonging to another member ....

The Mark as SOLD option appears in the drop down box, but when I click on it, I received a "No Permissions error ...."

Yes, I have the Usergroup box for Admins checked to YES ... ;)

I thought Admins could do this, or have I missed something in the instructions? :confused:

Regards,
Doug

I'm currently using 4.1.2, but if you want to pm me the site and a temp admin password I can take a look and see if I can find the problem. Kind of new to development so would have to play around with the set up to see what's going on.

venom2124 03-22-2011 12:40 AM

Okay found a possible problem in the coding. Try the new zip file reload files and install product again overwriting the old product file.

venom2124 03-22-2011 02:15 AM

Okay problem is solved. Had some coding issue that have been resolved. Loaded on another site I admin on and working perfectly now.

If you have already loaded the files just reload the updated sold.php to your forum folder and it will work like a charm.

MikeTrin 03-22-2011 02:28 AM

i tried version 1.1 with vbulletin 4.0.4, couldn't get the permissions set correctly. I enabled the thread prefix for all groups, turn it on in the classified forums, enabled it for all user groups but would get a message that I don't have permission to mark a thread sold. even when i tried as site admin.

if you can think of anything that may help please let me know, i may mess with it later.

venom2124 03-22-2011 02:32 AM

Quote:

i tried version 1.1 with vbulletin 4.0.4, couldn't get the permissions set correctly. I enabled the thread prefix for all groups, turn it on in the classified forums, enabled it for all user groups but would get a message that I don't have permission to mark a thread sold. even when i tried as site admin.

if you can think of anything that may help please let me know, i may mess with it later.
Upload the sold.php from version 1.2 and you'll be good to go.

BadgerDog 03-22-2011 10:14 AM

Re-tested patched v1.2 with thanks against 4.04 vBulletin ...

ALL field titles and descriptions now appear correctly ... :up:

As an Admin, selected a random WTS (Want to Sell) post in or Buy/Sell forum, posted by another member. Clicked drop down box and selected "Mark as Sold". Worked correctly and post now displayed [SOLD] instead of the prefix WTS: :up:

As an Admin, selected the SAME WTS (Want to Sell) post in or Buy/Sell forum. Clicked drop down box and selected "Mark as Unsold". Worked correctly, however, the post no longer displays a prefix at all, when it should reverse itself and display the original prefix, in this case it would have been WTS: :confused:

Can this be addressed, or is going to be a design limitation as I don't know how tou would keep track of what the original prefix was, except perhaps not replacing it, but simply adding [SOLD] in front of the original prefix?

Good job overall so far ... :up:

Regards,
Doug

Edit: Also, where can the phrase [SOLD] be changed so that it appears in a color of our choosing?

venom2124 03-22-2011 08:56 PM

Quote:

Originally Posted by BadgerDog (Post 2176152)
Re-tested patched v1.2 with thanks against 4.04 vBulletin ...

ALL field titles and descriptions now appear correctly ... :up:

As an Admin, selected a random WTS (Want to Sell) post in or Buy/Sell forum, posted by another member. Clicked drop down box and selected "Mark as Sold". Worked correctly and post now displayed [SOLD] instead of the prefix WTS: :up:

As an Admin, selected the SAME WTS (Want to Sell) post in or Buy/Sell forum. Clicked drop down box and selected "Mark as Unsold". Worked correctly, however, the post no longer displays a prefix at all, when it should reverse itself and display the original prefix, in this case it would have been WTS: :confused:

Can this be addressed, or is going to be a design limitation as I don't know how tou would keep track of what the original prefix was, except perhaps not replacing it, but simply adding [SOLD] in front of the original prefix?

Good job overall so far ... :up:

Regards,
Doug

Edit: Also, where can the phrase [SOLD] be changed so that it appears in a color of our choosing?

Yeah I'll have to see if there is a way to get the old prefix back, but again kind of new to this whole thing so that might be the only real downfall.

I can't really see too many items getting unsold if the user marks them sold after they are sold. It might be a bigger issue if you were working with a sale pending type deal.

Will still see if it can be done though.

Glad it's working for you now though for sure.

And yes you can modify the [Sold] by going to the thread prefix manager then select edit for The sold prefix. There you will see the plain text and rich text boxes. You can change the Plain text to Just Sold and then you can add HTML code to the rich text box to change the color, add bold, or just set it up how you would like.

Kenjiwing 03-24-2011 05:49 PM

Venom Just sent you a PM.. hope you will have time to check it! Thanks!

venom2124 03-25-2011 03:39 AM

PM replied to.

Shootsteel 03-25-2011 04:03 PM

Sorry for what may be a simple question to what is possibly a very simple answer. How can I change the color and add BOLD to the SOLD prefix?

Great little mod by the way ;)

Edit: I figured it all out, thanks for the great mod.

venom2124 03-26-2011 12:49 AM

Quote:

Originally Posted by Shootsteel (Post 2177355)
Sorry for what may be a simple question to what is possibly a very simple answer. How can I change the color and add BOLD to the SOLD prefix?

Great little mod by the way ;)

Edit: I figured it all out, thanks for the great mod.

Glad you figured it out. Enjoy!!

Sforums 03-26-2011 09:17 AM

Quote:

Originally Posted by venom2124 (Post 2177537)
Glad you figured it out. Enjoy!!

Same question here, can't figure it out....please help. :D
Other than that, awesome mod, 5 star and marked installed.

venom2124 03-26-2011 02:48 PM

Go to the Thread Prefix Manager in the AdminCp

Then where you see the SOLD thread prefix click Edit

This will take you to the screen you need to edit the rich text to make it appear how you would like on the forum.

Here is a picture of the screen and the code changes I made for my site.

https://vborg.vbsupport.ru/external/2011/03/6.png

Sforums 03-26-2011 04:36 PM

Thanks venom!

venom2124 03-27-2011 12:42 AM

Quote:

Originally Posted by Sforums (Post 2177721)
Thanks venom!


Your welcome. Hope it works out well for you.

Shootsteel 03-27-2011 03:04 PM

Just curious, are you planning on doing any other versions of this mod? As in WTS [want to sell], WTB [want to buy], LTT [looking to trade]?

Or if you know of other mods for these specific things and could point me in the right direction, it would be much appreciated!!

Thanks again for this great little mod, marked as installed and it's on my live site :)

venom2124 03-27-2011 03:42 PM

Quote:

Originally Posted by Shootsteel (Post 2177979)
Just curious, are you planning on doing any other versions of this mod? As in WTS [want to sell], WTB [want to buy], LTT [looking to trade]?

Or if you know of other mods for these specific things and could point me in the right direction, it would be much appreciated!!

Thanks again for this great little mod, marked as installed and it's on my live site :)

I find that just adding the prefixes for those choices is easier and gives the user the ability to choose when they are posting there ads works best. I can't really see how changing the current mod would work out for what you are asking. Since this mod is more developed to give the user the ability to change the prefix after the fact to change it to sold. Now if you are not sure how to set up prefixes let me know and I can try and give you an overview on how to set it up.

Now if people need something different for after the fact changes I can probably see about working with them to make it happen.

Shootsteel 03-27-2011 09:02 PM

Ahh I see how it goes now. I got it all figured now.....again, lol.

your24hourstore 03-28-2011 11:08 AM

tested this and found the uninstall blew up, the xml must have a problem in that area.
also I couldn't get the post to close automatically. I dont want to give the whole board control to close threads , just the classifieds category

Shootsteel 03-28-2011 01:41 PM

As far as the uninstall, can't help ya there as I have not uninstalled the product yet, :\

For the thread to close automatically after you want to set a thread as sold, then it must be done by "Thread Tools -> Mark this thread as sold..." option NOT by editing the post and changing the prefix to SOLD, at least as far as I'm aware.

You can choose what sections of your board will have the SOLD [close] option.

Thread Prefixes -> Thread Prefix Manager -> up where it says "sold thread" all the way to the right, after [Add Prefix] click on "edit" and choose the categories you want to use this mod.

venom2124 03-28-2011 10:16 PM

Quote:

Originally Posted by your24hourstore (Post 2178279)
tested this and found the uninstall blew up, the xml must have a problem in that area.
also I couldn't get the post to close automatically. I dont want to give the whole board control to close threads , just the classifieds category

Not sure what the issue is with the uninstall since I could not duplicate it when I uninstalled the product on my board. So I'm not sure where to start with helping you with that issue.

As for closing the thread automatically, like the post above says you have to set it to that option for that feature to work. That is under the options-->Mark as Sold.

If you have screen shots of what the issue was during the uninstall I might be able to help. Also what version of the product did you have installed?

I would suggest trying to up load the current files and product file allowing for overwrite of previous files and see if that fixes the issue.

venom2124 03-30-2011 03:00 AM

Quote:

Originally Posted by Kenjiwing (Post 2177065)
Venom Just sent you a PM.. hope you will have time to check it! Thanks!

Still taking a look at coding to see if I can help with your request.

your24hourstore 03-30-2011 03:13 AM

I see you logged in . unfortunately I didn't have a good backup so had to reinstall the whole board, so not sure what mod was conflicting, it really doesnt matter as it just a test site for mods and features, reinstalled it and seems to be all good, except that i cant figure out how to get them to close after changing the prefix to sold.

your24hourstore 03-30-2011 03:22 AM

1 Attachment(s)
I set the settings to auto close in the settings options in admincp

see! :{ after i change the prefix still open to reply oh 4.1.2 is the version

I feel this is a worthwhile mod to develop has a lot of possibility,

i think i have all the settings set to auto close but just not doing it for me.
since you made an account log in and make a n ad then mark it sold :} with the user permissions i have enabled if you have time later.
added:
OK I'm sure its not working in this new version its all installed and prefix selection works manually on post and edit,

but the thread drop down control does not have the option to mark as sold, and I don't see any screens showing you giving the users permission to close a thread.

here is the thread control screen of my install, so i guess the prefix options are working but don't seem to be using any outside files I uploaded from the install zip like sold.php

PHP Code:

<vb:if condition="$show['addpoll']">
                        <
li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}poll.php?{vb:raw session.sessionurl}do=newpoll&amp;t={vb:raw threadid}">{vb:rawphrase add_a_poll_to_this_thread}&hellip;</a></li>
                    </
vb:if> 

this is the vb if condition in the new version


changed your show template code to match the new version and it works now


PHP Code:

  <vb:if condition="$show['soldthread']">
                              <
li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}sold.php?{vb:raw session.sessionurl}do=marksold&amp;t={vb:raw threadid}">{vb:rawphrase soldthread_marksold}&hellip;</a></li>
                          <
vb:else />
                              <
vb:if condition="$show['soldthread_unsold']">
                              <
li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}sold.php?{vb:raw session.sessionurl}do=markunsold&amp;t={vb:raw threadid}">{vb:rawphrase soldthread_markunsold}&hellip;</a></li>
                              </
vb:if>
                          </
vb:if> 


your24hourstore 03-30-2011 04:11 PM

Quote:

Originally Posted by your24hourstore (Post 2178998)
I set the settings to auto close in the settings options in admincp

see! :{ after i change the prefix still open to reply oh 4.1.2 is the version

I feel this is a worthwhile mod to develop has a lot of possibility,

i think i have all the settings set to auto close but just not doing it for me.
since you made an account log in and make a n ad then mark it sold :} with the user permissions i have enabled if you have time later.
added:
OK I'm sure its not working in this new version its all installed and prefix selection works manually on post and edit,

but the thread drop down control does not have the option to mark as sold, and I don't see any screens showing you giving the users permission to close a thread.

here is the thread control screen of my install, so i guess the prefix options are working but don't seem to be using any outside files I uploaded from the install zip like sold.php

PHP Code:

<vb:if condition="$show['addpoll']">
                        <
li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}poll.php?{vb:raw session.sessionurl}do=newpoll&amp;t={vb:raw threadid}">{vb:rawphrase add_a_poll_to_this_thread}&hellip;</a></li>
                    </
vb:if> 

this is the vb if condition in the new version


changed your show template code to match the new version and it works now


PHP Code:

  <vb:if condition="$show['soldthread']">
                              <
li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}sold.php?{vb:raw session.sessionurl}do=marksold&amp;t={vb:raw threadid}">{vb:rawphrase soldthread_marksold}&hellip;</a></li>
                          <
vb:else />
                              <
vb:if condition="$show['soldthread_unsold']">
                              <
li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}sold.php?{vb:raw session.sessionurl}do=markunsold&amp;t={vb:raw threadid}">{vb:rawphrase soldthread_markunsold}&hellip;</a></li>
                              </
vb:if>
                          </
vb:if> 


:up: OK its fixed with the New showthread code i posted just make a new version update and use this new code seems to work with 4.1.2 now

rated excellent and nominated :

venom2124 03-30-2011 11:21 PM

Glad you got it working, but not sure what coding you were changing. I've installed this on two seperate boards with 4.1.2 and it worked like a charm on both. I'm almost thinking you didn't make the template mod or something, but again I'm just not sure.

your24hourstore 03-31-2011 01:40 AM

yes not sure what the heck was going on but I know for sure that the edit code you have showing is not whats in version 4.1.2 :)

the code i posted here https://vborg.vbsupport.ru/showpost....8&postcount=35 has the code that is in this new version 4.1.2, its easy to see its not what you have posted at the top of this page. seems to work great though with this changed code for me. if for some reason it doesn't work for new installs im sure this code does work because that's what is in my show thread npw. so it does work

your24hourstore 03-31-2011 01:43 AM

this mod rocks by the way I'm really liking it and plan to install it for a few people now
I would like it to show the prefix in the recent thread mods for cms widget that would be super. now it doesn't show the prefix in the recent threads or recent posts

your24hourstore 03-31-2011 02:11 AM

lol this is driving me nuts im going to try your code again and see if it works.
this new code doesn't refresh the show thread at the forum level. works everywhere else probably in the php

venom2124 03-31-2011 02:13 AM

Quote:

Originally Posted by your24hourstore (Post 2179277)
lol this is driving me nuts im going to try your code again and see if it works.
this new code doesn't refresh the show thread at the forum level. works everywhere else probably in the php

If you want to give me temp admin access I can take a look at it and see if I can figure out the disconnect.


All times are GMT. The time now is 05:29 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01616 seconds
  • Memory Usage 1,915KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_html_printable
  • (4)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete