vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 5.x Products & Extensions (https://vborg.vbsupport.ru/forumdisplay.php?f=258)
-   -   Mini Mods - Create new thread button (https://vborg.vbsupport.ru/showthread.php?t=327486)

delicjous 08-25-2019 09:00 PM

Create new thread button
 
1 Attachment(s)
I made a mod for this in the past, but I decide to make it compatible with cloud.

Installinstructions:

Just create a template and hook it to footer_before_body_end.

-Create a template: /admincp/template.php?do=modify& -> choose action dropdown -> Add new template.

Hook it to footer_before_body_end: /admincp/hook.php? Create new hook at the bottom, choose the mentioned hook and put the name of the template into "Template Name".

Fill the template with the following code:
HTML Code:

<style>
.deli-crneto li {
        font-size:15px;
        margin-bottom:5px;
        line-height:16px;
}
.deli-crneto #btnConfirmDialogYes {
        display:none;
}
.deli-crneto .delicnt_cat {
        background-color:lightgray;
}
</style>
<script>
function delinewthreadpopup(){var a=openConfirmDialog({title:vBulletin.phrase.get("create_new_topic"),message:vBulletin.phrase.get("loading")+"...",width:500,dialogClass:"deli-crneto loading",buttonLabel:{noLabel:vBulletin.phrase.get("cancel")}});vBulletin.AJAX({call:"/ajax/api/node/fetchChannelNodeTree",data:{parentid:2,depth:5,pagenum:1,perpage:150},success:function(e){$(".deli-crneto").removeClass("loading"),$(".dialog-content .message",a).html('<ul class="crneto_list"></ul>'),$.each(e.channels,function(e,a){var t=pageData.baseurl+"/new-content/"+e;1==a.category?$(".crneto_list").append('<li class="depth_'+a.depth+' delicnt_cat">'+a.title+"</li>"):$(".crneto_list").append('<li class="depth_'+a.depth+'"><a href="'+t+'">  '+a.title+"</a></li>"),void 0!==a.subchannels&&$.each(a.subchannels,function(e,a){var t=pageData.baseurl+"/new-content/"+e;$(".crneto_list").append('<li class="depth_'+a.depth+'"><a href="'+t+'">  &nbsp&nbsp '+a.title+"</a></li>"),void 0!==a.subchannels&&$.each(a.subchannels,function(e,a){var t=pageData.baseurl+"/new-content/"+e;$(".crneto_list").append('<li class="depth_'+a.depth+'"><a href="'+t+'">  &nbsp&nbsp&nbsp&nbsp  '+a.title+"</a></li>")})})})},error:vBulletin.ajaxtools.logAjaxError,api_error:vBulletin.ajaxtools.logApiError})}$("#delicreatenewthread").click(function(e){e.preventDefault(),delinewthreadpopup()});
</script>

Now you could place a button everywhere you want like that:
HTML Code:

<button id="delicreatenewthread" class="b-button b-button--special" type="submit">Create a new Thread</button>
You could also use every other html-tags. Just put the id on it: id="delicreatenewthread"

It is just an example but ready to use.

Kinkshaven 08-26-2019 06:51 PM

Hmm this breaks our registration forum

delicjous 08-27-2019 01:39 AM

Quote:

Originally Posted by Kinkshaven (Post 2600402)
Hmm this breaks our registration forum

Please try the updated code. There was a wrong script-tag at the end of it. Iam sorry!

migratoria 08-27-2019 10:14 AM

You have a screenshot?

Kinkshaven 08-27-2019 11:21 AM

1 Attachment(s)
Quote:

Originally Posted by migratoria (Post 2600414)
You have a screenshot?

Here you go I attached some (please ignore the black out it's just we run a NSFW forum)

alphega 05-07-2020 01:05 PM

Hello, thanks for this mod.

But for me it works not on VB 5.6.0, a blank Windows appears, load few instants and display nothing. Any idea please ?

https://www.cnetfrance.fr/i/edit/fo/2020/05/button.jpg

delicjous 05-07-2020 01:48 PM

Did you update from a previous version or is it a fresh installed vB?

alphega 05-08-2020 11:49 AM

Thanks for your reply :)

It's a fresh update from VB4. I tried to set it in module, notices and templates but got the same result.

delicjous 05-08-2020 03:51 PM

I will take a look as soon I have time for it

ywwz 09-11-2020 03:27 AM

5.6.3 compatible?


All times are GMT. The time now is 06:41 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.03375 seconds
  • Memory Usage 1,737KB
  • 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_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete