vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Add-On Releases - DownloadsII Create New Thread Add-On (https://vborg.vbsupport.ru/showthread.php?t=130995)

CyberRanger 11-06-2006 10:00 PM

DownloadsII Create New Thread Add-On
 
What does it do?
When a user uploads or updates a file via DownloadsII a thread is created or updated in the specificed forum.

DownloadsII Create New Thread Add-On, is not a stand-alone mod. It requires DownloadsII 5.0.4 or higher.
You can find it here: https://vborg.vbsupport.ru/showthread.php?t=120122 (free)


Features
  1. Ability to global select the forum that receives the new thread and the userid of the thread creator.
  2. Ability to decide what forum receives the new thread and the thread creator based on the category of the file
  3. Option to have the thread created by the uploader or always assigned to the same user account
  4. Option to never create threads by category
  5. Usergroup permissions for being allowed to create a new thread
  6. Link added between thread in Downloads file detail (optional).
  7. Updated Downloads entry creates new post in thread alerting of an update.
  8. Database link to Downloads file entry removed if thread is deleted.
  9. If the Downloads new entry is placed in moderation, so is the thread.
  10. Option to have new threads locked.
Installation
  1. Upload the files in the upload folder into your forum directory.
  2. From the admincp, import the product file product-dl2_thread.xml
  3. From the admincp, set the options under "DownloadsII - Create Threads"
  4. Be sure to set the usergroup permissions!
  5. Done!

CyberRanger 11-07-2006 03:48 PM

{reserved}

Robbed 11-07-2006 03:51 PM

Will it display the pictures?

CyberRanger 11-07-2006 03:55 PM

Quote:

Originally Posted by Robbed
Will it display the pictures?

In the thread, it will display whatever is in the "Description" of the file addition. If you've used an [img] tag in the description, that will display in the thread.

The attached pic shows a thread that was created from a file upload that had an [img] tag in the "Description"

Robbed 11-07-2006 03:59 PM

Can you have it bring over the uploaded image and have them in img tags?

CyberRanger 11-07-2006 04:01 PM

Quote:

Originally Posted by Robbed
Can you have it bring over the uploaded image and have them in img tags?

No, I don't think that's possible. The images are added after the file entry is done in DownloadsII. That means the thread has already been created before the images are uploaded.

I'll try to figure out someway to do that but right now it's not set that way. I may be able to have an update to the thread done whenever an image is added. The update post could contain the image.

teedizz 11-07-2006 04:04 PM

Nice hack, just wondering if you could help me out in your RSS feed hack also. Thanks.

Jay... 11-07-2006 05:51 PM

is there anyway the poster could be the user who uploaded the file? that would be brilliant

CyberRanger 11-07-2006 06:04 PM

Quote:

Originally Posted by Jay...
is there anyway the poster could be the user who uploaded the file? that would be brilliant

By default it is! Just leave the Default UserID as -1.

https://vborg.vbsupport.ru/

Jay... 11-07-2006 06:37 PM

Quote:

Originally Posted by CyberRanger
By default it is! Just leave the Default UserID as -1.

http://www.brentandmary.net/images/e...p_settings.gif

spot on! ill have some of that!

NiTRoN 11-07-2006 07:26 PM

Thanks for superb idea.. nice way for users to find out about new files being added.. If I may.. I have one request.. Can you add option (admin selectable)when the file is deleted.. the thread gets removed as well?

-Thank You..

P.S. I'm running this on 3.6.2 and so far works great..

CyberRanger 11-07-2006 07:58 PM

Quote:

Originally Posted by NiTRoN
Can you add option (admin selectable)when the file is deleted.. the thread gets removed as well?

sure thing! I add that option in the next version.

klaush 11-08-2006 05:38 AM

Amazing! Thanks a lot for this great stuff!

One request, is it possible to close a created thread automatically?

maroceve 11-08-2006 10:41 AM

What would be brilliant is to not only add a basic link to the file when it creates a thread but, to have it automatically considered as a new podcast.

Zia 11-08-2006 04:04 PM

Its a nice idea man..
thnx..

hope it will work with vb3.6.3
umm... can u do few more modification ,

like: a)thread will be open for mass imported file ..
b)One thread of 12 track Of an album..Customizeable
one thread for each track/file or One thread for *trac/file ?

what ever it suits for this add-ons...

can u plz give a thought for it

beduino 11-09-2006 07:20 PM

Tks! Once again... a excepcional work!
beduino
ps. works in vb 3.6.x?

CyberRanger 11-09-2006 07:24 PM

Quote:

Originally Posted by beduino
ps. works in vb 3.6.x?

Yes! I'm working on getting it to work for mass imports too. Having a little trouble there:tired:

NiTRoN 11-10-2006 06:16 AM

Quote:

Originally Posted by Zia
Its a nice idea man..
thnx..

hope it will work with vb3.6.3
umm... can u do few more modification ,

like: a)thread will be open for mass imported file ..
b)One thread of 12 track Of an album..Customizeable
one thread for each track/file or One thread for *trac/file ?

what ever it suits for this add-ons...

can u plz give a thought for it


Personally I think.. if you would use the import feature.. I would rather have it to create 1 thread with the "New Files Added to "Category Name Goes Here" and then list the files in the post.. Because if you would to import 50 files.. creating 50 separate threads would flood out the forum.. So maybe that could be an option "Group Files in Thread on mass import"

Robbed 11-11-2006 12:43 AM

On the add file screen does the user have the option to not create a thread?

HappyPike 11-11-2006 02:17 AM

Hi CyberRanger,

Can I specify different forum to create threads in for each category?

As always, keep up the good work! :up:

CyberRanger 11-11-2006 03:42 AM

Quote:

Originally Posted by Robbed
On the add file screen does the user have the option to not create a thread?

No, but I plan to add that. I need to put more hooks into downloads.php first:)

CyberRanger 11-11-2006 03:43 AM

Quote:

Originally Posted by HappyPike
Hi CyberRanger,

Can I specify different forum to create threads in for each category?

As always, keep up the good work! :up:

Yes, each category can have it's own forum specified.

HappyPike 11-11-2006 04:10 AM

That's cool. :) This is gonna be very useful.

Quote:

Originally Posted by CyberRanger
No, but I plan to add that. I need to put more hooks into downloads.php first:)

Looking forward to it... It'd be good to give users the option.

NiTRoN 11-11-2006 04:37 AM

I wouldn't be suprized if this addon got merged with the Downloads2 product.. it would be really nice if it did.. even as just being addon makes me happy :)

klaush 11-11-2006 04:59 AM

Thanks for this. One issue:

Datenbankfehler in vBulletin 3.5.4:

Invalid SQL:
UPDATE vb3_dl_files SET `description`='While LightZone 2.0 is still in beta, Light Crafts is offering an Open Beta download for current and potential customers to see what's new in LightZone 2.0.

Diese Beta ist lauff?hig bis zum 14. November 2006


Thread Discussion' WHERE `id`=156;

MySQL-Fehler : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's new in LightZone 2.0.

[B]Diese Beta ist lauff?hig bis zum 14. November 2006' at line 1
Fehler-Nr. : 1064
----

The description to the download seems to force an error with the database.

Any idea what?s going wrong?

CyberRanger 11-11-2006 12:32 PM

Quote:

Originally Posted by klaush
Thanks for this. One issue:...

The description to the download seems to force an error with the database.

Any idea what?s going wrong?

Rats, looks like I needed to add an escape for the quotes. I'll get a new release out in a day or two.

CyberRanger 11-12-2006 04:49 PM

Version 1.0.1 released to fix a bug if the file description contained a single or double quote.

Many more features coming later this week!:D

NiTRoN 11-13-2006 02:57 AM

Can there be option in the settings letting admins decide if they want to place link to a thread in description of file instead just being on by default?

klaush 11-13-2006 03:10 AM

Quote:

Originally Posted by CyberRanger (Post 1115587)
Version 1.0.1 released to fix a bug if the file description contained a single or double quote.

Many more features coming later this week!:D

We have this problem when installing the product.

Invalid SQL:

### INSERT QUERY GENERATED BY fetch_query_sql() ###
INSERT INTO vb3_plugin
(`active`, `executionorder`, `title`, `hookname`, `phpcode`, `product`)
VALUES
('1', '5', 'DownloadsII Create Threads Cache Templates', 'cache_templates', '$globaltemplates = array_merge($globaltemplates, array(\'downloadii_create_newthread\', \'downloadii_create_newthread_title\',\'downloadii _create_newthread_desc\',\'downloadii_create_post\ '));', 'dl2_thread');


MySQL-Fehler : Unknown column 'executionorder' in 'field list'
Fehler-Nr. : 1054
Datum : Monday, November 13th 2006 @ 06:07:25 AM

klaush 11-13-2006 03:58 AM

O.k., just had to delete the lines "executionorder" in the xml-file; so it works for 3.5.5.

CyberRanger 11-13-2006 11:25 AM

Quote:

Originally Posted by klaush (Post 1116025)
O.k., just had to delete the lines "executionorder" in the xml-file; so it works for 3.5.5.

Sorry, I forgot to remove that after exporting the product file. The product file in the attached zip has the "executionorder" removed so the product will install fine with vb ver 3.5.x and up.

Hel_Sir 11-13-2006 04:29 PM

Ok, n00bish question.. I saw you could set a global ForumID for where to post the new download.. So, I take that as its the display order or? I get an error stating: Sorry! This forum is not accepting new posts.
Where did I go wrong? :D

CyberRanger 11-13-2006 04:38 PM

Quote:

Originally Posted by Hel_Sir (Post 1116407)
So, I take that as its the display order or? I get an error stating: Sorry! This forum is not accepting new posts.
Where did I go wrong? :D

When you click into a forum, the forumid is displayed at the end of the url. For example, "forum/forumdisplay.php?f=7" is a forum with a forumid of 7.

Ohh-Dutch 11-13-2006 05:25 PM

Code:

Database error in vBulletin 3.5.4:

Invalid SQL:

### INSERT QUERY GENERATED BY fetch_query_sql() ###
INSERT INTO plugin
        (`active`, `executionorder`, `title`, `hookname`, `phpcode`, `product`)
VALUES
        ('1', '5', 'DownloadsII Create Thread on Edit', 'dl_post_upload_edit', 'global $vbulletin;\r\n$cat = $db->query_first(\"SELECT category, dl_forumid_cat, dl_userid_cat, dl_no_threads, dl_threadid\r\n                        FROM \" . TABLE_PREFIX . \"dl_cats, \" . TABLE_PREFIX . \"dl_files\r\n                        WHERE \" . TABLE_PREFIX . \"dl_cats.id =  \". TABLE_PREFIX . \"dl_files.category AND\r\n                        \" . TABLE_PREFIX . \"dl_files.id=\".$db->sql_prepare($_GET[\'id\']));\r\n\r\n// only try to build new thread if we have a forumid greater than zero, thread creation permitted, and no existing thread\r\n        \r\nif (($vbulletin->options[\'downloadsii_createthread_default_forumid\'] > 0 OR $cat[\'dl_forumid_cat\'] > 0) AND $cat[\'dl_no_threads\'] == 0 AND ($permissions[\'dl2_threadpermissions\'] & $vbulletin->bf_ugp[\'dl2_threadpermissions\'][\'cancreatethreads\']) AND $cat[\'dl_threadid\'] < 1 )\r\n{\r\n    $id = $_GET[\'id\'];\r\n\r\n        if ($cat[\'dl_forumid_cat\'] > 0)\r\n        {\r\n                $foruminfo = fetch_foruminfo(&$cat[\'dl_forumid_cat\'], 1);\r\n        } else {\r\n                $foruminfo = fetch_foruminfo(&$vbulletin->options[\'downloadsii_createthread_default_forumid\'], 1);\r\n        }\r\n        \r\n        \r\n\r\n        if (!$foruminfo[\'forumid\'])\r\n        {\r\n                eval(standard_error(fetch_error(\'invalidid\', $vbphrase[\'forum\'], $vbulletin->options[\'contactuslink\'])));\r\n        }\r\n        \r\n        if (!$foruminfo[\'allowposting\'] OR $foruminfo[\'link\'] OR !$foruminfo[\'cancontainthreads\'])\r\n        {\r\n                eval(standard_error(fetch_error(\'forumclosed\')));\r\n        }\r\n        \r\n        \r\n        $forumperms = fetch_permissions($foruminfo[\'forumid\']);\r\n        if (!($forumperms & $vbulletin->bf_ugp_forumpermissions[\'canpostnew\']))\r\n        {\r\n                print_no_permission();\r\n        }\r\n        \r\n        \r\n        // determine the userid to use\r\n        if ($cat[\'dl_userid_cat\'] > 0)\r\n        {\r\n                $userid = $cat[\'dl_userid_cat\'];\r\n                \r\n        } elseif ($vbulletin->options[\'downloadsii_createthread_default_userid\'] > 0){\r\n        \r\n                $userid = $vbulletin->options[\'downloadsii_createthread_default_userid\'];\r\n                \r\n        } else {\r\n        \r\n                $userid = $vbulletin->userinfo[\'userid\'];\r\n        }\r\n        \r\n        $userstuff = fetch_userinfo($userid,1);\r\n        $forumid = $foruminfo[\'forumid\'];\r\n        $postuserid = $userstuff[\'userid\'];\r\n        $username = $userstuff[\'username\'];\r\n        /* $pagetext = $_POST[\'desc\']; */\r\n        /* $title = $_POST[\'dname\']; */\r\n        eval(\'$pagetext .= \"\' . fetch_template(\'downloadii_create_newthread\') . \'\";\');\r\n        eval(\'$title .= \"\' . fetch_template(\'downloadii_create_newthread_title\') . \'\";\');\r\n        \r\n        $allowsmilie = \'1\';\r\n        \r\n        if ($_POST[\'purgatory\'] == 1)\r\n        {\r\n                $visible = 0;\r\n        } else {\r\n                $visible = 1;\r\n        }        \r\n        \r\n        // code to create new thread\r\n                require_once(DIR . \'/includes/functions_databuild.php\'); /* included to build new thread and update counters */ \r\n                $threaddm =& datamanager_init(\'Thread_FirstPost\', $vbulletin, ERRTYPE_ARRAY, \'threadpost\');\r\n                $threadinfo = array();\r\n                \r\n                $threaddm->set_info(\'forum\', $foruminfo);\r\n                $threaddm->set_info(\'thread\', $threadinfo);\r\n                $threaddm->setr(\'forumid\', $forumid);\r\n                $threaddm->setr(\'userid\', $userid);\r\n                $threaddm->setr(\'pagetext\', $pagetext);\r\n                $threaddm->setr(\'title\', $title);\r\n                $threaddm->set(\'allowsmilie\', $allowsmilie);\r\n                $threaddm->set(\'visible\', $visible);\r\n                \r\n                $threaddm->pre_save();\r\n                if(count($threaddm->errors) < 1)\r\n                {\r\n                        $threadid = $threaddm->save();\r\n                        unset($threaddm);\r\n                        build_thread_counters($threaddm);\r\n                } else {\r\n                        eval(standard_error(fetch_error($threaddm->errors, $vbphrase[\'forum\'], $vbulletin->options[\'contactuslink\'])));\r\n                }\r\n                \r\n                build_forum_counters($foruminfo[\'forumid\']);  \r\n        // end code to create new thread\r\n\r\n        if ($threadid > 0)\r\n        {\r\n                $db->query_write(\"UPDATE \" . TABLE_PREFIX . \"dl_files SET `dl_threadid`=\'\".$threadid.\"\' WHERE `id`=\".$db->sql_prepare($id));\r\n                eval(\'$desc_new .= \"\' . fetch_template(\'downloadii_create_newthread_desc\') . \'\";\');\r\n                $db->query_write(\"UPDATE \" . TABLE_PREFIX . \"dl_files SET `description`=\'\".$desc_new.\"\' WHERE `id`=\".$db->sql_prepare($id));\r\n        }\r\n                \r\n\r\n}elseif (($vbulletin->options[\'downloadsii_createthread_default_forumid\'] > 0 OR $cat[\'dl_forumid_cat\'] > 0) AND $cat[\'dl_no_threads\'] == 0 AND ($permissions[\'dl2_threadpermissions\'] & $vbulletin->bf_ugp[\'dl2_threadpermissions\'][\'cancreatethreads\']) AND $cat[\'dl_threadid\'] > 0 )\r\n{\r\n\r\n        require_once(\'./includes/class_dm.php\');\r\n        require_once(\'./includes/class_dm_threadpost.php\');\r\n        \r\n        $postdm = new vB_DataManager_Post($vbulletin, ERRTYPE_STANDARD);\r\n        \r\n        $postthreadid = $cat[\'dl_threadid\'];\r\n        // determine the userid to use\r\n        if ($cat[\'dl_userid_cat\'] > 0)\r\n        {\r\n                $userid = $cat[\'dl_userid_cat\'];\r\n                \r\n        } elseif ($vbulletin->options[\'downloadsii_createthread_default_userid\'] > 0){\r\n        \r\n                $userid = $vbulletin->options[\'downloadsii_createthread_default_userid\'];\r\n                \r\n        } else {\r\n        \r\n                $userid = $vbulletin->userinfo[\'userid\'];\r\n        }\r\n        \r\n        $userstuff = fetch_userinfo($userid,1);\r\n        $postuserid = $userstuff[\'userid\'];\r\n        $id = $_GET[\'id\'];\r\n\r\n        \r\n        $threadinfo = fetch_threadinfo($postthreadid);\r\n        $foruminfo = fetch_foruminfo($threadinfo[\'forumid\']);\r\n        \r\n        if (!$foruminfo[\'forumid\'])\r\n        {\r\n                eval(standard_error(fetch_error(\'invalidid\', $vbphrase[\'forum\'], $vbulletin->options[\'contactuslink\'])));\r\n        }\r\n        \r\n        if (!$foruminfo[\'allowposting\'] OR $foruminfo[\'link\'] OR !$foruminfo[\'cancontainthreads\'])\r\n        {\r\n                eval(standard_error(fetch_error(\'forumclosed\')));\r\n        }\r\n        \r\n        \r\n        $forumperms = fetch_permissions($foruminfo[\'forumid\']);\r\n        if (!($forumperms & $vbulletin->bf_ugp_forumpermissions[\'canpostnew\']))\r\n        {\r\n                print_no_permission();\r\n        }\r\n        \r\n        eval(\'$postpagetext .= \"\' . fetch_template(\'downloadii_create_post\') . \'\";\');\r\n        \r\n        $postdm->set_info(\'forum\', $foruminfo);\r\n        $postdm->set_info(\'thread\', $threadinfo);  \r\n        $postdm->set(\'threadid\', $postthreadid);\r\n        //$postdm->set(\'username\', $postusername);\r\n        // Use $postusername if posting as a guest, use $postuserid if posting as a user\r\n        $postdm->set(\'userid\', $postuserid);\r\n        $postdm->set(\'pagetext\', $postpagetext);\r\n        $postdm->set(\'allowsmilie\', 1);\r\n        $postdm->set(\'visible\', 1);\r\n        $postdm->set(\'dateline\', TIMENOW);\r\n        $postdm->save();\r\n        unset($postdm);  \r\n        require_once(DIR . \'/includes/functions_databuild.php\');\r\n        build_forum_counters($threadinfo[\'forumid\']);  \r\n}', 'dl2_thread');

any idea how u can help?

CyberRanger 11-13-2006 05:35 PM

Quote:

Originally Posted by Ohh-Dutch (Post 1116442)
Code:

Database error in vBulletin 3.5.4:

Invalid SQL:

### INSERT QUERY GENERATED BY fetch_query_sql() ###
INSERT INTO plugin
        (`active`, `executionorder`, `title`, `hookname`, `phpcode`, `product`)
VALUES

any idea how u can help?

Yes, I can stop being an idiot!!! :D Sorry, I missed one of the "executionorder" statements that cause the install to blow-up for vb 3.5.x. Please download the newly attached producted file, unzip it, and install product-dl2_thread.xml

Ohh-Dutch 11-13-2006 05:45 PM

Okay It Fixed The DB Problem, But When I Add Something, It DOesnt Show The New Thread... Is There A Certain Amount Of TIme? I Also Edited Usergroup Permissions As Well.... And Vbulletin Options...

CyberRanger 11-13-2006 05:52 PM

Quote:

Originally Posted by Ohh-Dutch (Post 1116456)
Okay It Fixed The DB Problem, But When I Add Something, It DOesnt Show The New Thread... Is There A Certain Amount Of TIme? I Also Edited Usergroup Permissions As Well.... And Vbulletin Options...

No, there isn't a delay. In admincp -> Downloads - Create Threads -> Settings did you set "Always Create New Thread?" to "Yes" and specify a default forumid?

And ... what version of DownloadsII are you running?

Ohh-Dutch 11-13-2006 06:22 PM

Quote:

Originally Posted by CyberRanger (Post 1116465)
No, there isn't a delay. In admincp -> Downloads - Create Threads -> Settings did you set "Always Create New Thread?" to "Yes" and specify a default forumid?

And ... what version of DownloadsII are you running?


Yes I Put Forum ID: 14, Set TO Yes... But How Do i Check What Version Im Running? Here Check It Out... http://www.dubicon.com/board

Heres A Test Name:
username=Judge 1
Pass=Judge

CyberRanger 11-13-2006 06:46 PM

Quote:

Originally Posted by Ohh-Dutch (Post 1116486)
Yes I Put Forum ID: 14, Set TO Yes... But How Do i Check What Version Im Running? Here Check It Out... http://www.dubicon.com/board

Heres A Test Name:
username=Judge 1
Pass=Judge

Your DownloadsII program is at version 5.0.3. You must be at 5.0.4 for this add-on to work. :)

Ohh-Dutch 11-13-2006 07:18 PM

Quote:

Originally Posted by CyberRanger (Post 1116518)
Your DownloadsII program is at version 5.0.3. You must be at 5.0.4 for this add-on to work. :)


LOL, All That And I Cant Even Use It, I Get A Fatal Error Becuz Of Psionic Visions Battle Hack, WHich Also Interferes With The Mod Application Hack, Anything Used To Make A Thread Wont Work, If I Didnt Have A Rap Website, I Would Uninstall It, But Thanks Anyways, I Still Use Download II And Have Upgraded...


All times are GMT. The time now is 04:31 AM.

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.01636 seconds
  • Memory Usage 1,869KB
  • 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
  • (2)bbcode_code_printable
  • (19)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