vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   global new thread page (https://vborg.vbsupport.ru/showthread.php?t=106983)

pipedreams 02-02-2006 03:57 PM

global new thread page
 
Is anyone aware of a hack on vb where there is a global new thread page?

In other words instead of going to a forum and then selecting new thread, that they first select "new thread" and then pick a forum - (say as a dropdown in the new thread page.)

I'd imagine its a simple hack, but I have no time to go investigating it myself at the moment, so I be willing to pay for the right solution for my needs.

pipedreams 02-08-2006 12:01 PM

1 Attachment(s)
I found a workaround for this that will do above for me and I thought I might share it with others.

I have vbadvanced cpms 2.10 installed on vb 3.5.3.

So I created a new page on the cpms with only a modified version of the forumlist module

I changed the module it so that it goes to a new thread page for each forum instead of listing the forum threads.

Example http://www.gcn.ie/forum/cmps_index.php?page=newthread

ConqSoft 02-10-2006 04:56 PM

This is strange; I was just working on the same type of thing because of newbs that don't get how to create a new thread in the proper forum.

In any case, I was trying to modify your code so that if a forum is marked "Forum Is Open = No", then it would just display the text (no link).

This is the code I'm using, but it never gets to the "else" part; ie, it thinks they're all Closed. Any ideas?

Thanks

Code:

function add_newthread_list($parentid = -1, &$ret, $permission = '')
{
        global $vbulletin;
        global $stylevar, $vbphrase, $defaultselected;
        if (!($vbulletin->userinfo['permissions']['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']))
        {
                return;
        }
        if (empty($vbulletin->iforumcache))
        {
                require_once(DIR . '/includes/functions_forumlist.php');
                cache_ordered_forums(1, 1);
        }
        if (empty($vbulletin->iforumcache["$parentid"]) OR !is_array($vbulletin->iforumcache["$parentid"]))
        {
                return;
        }
        $ret.= "<ul>";
        foreach($vbulletin->iforumcache["$parentid"] AS $forumid)
        {
                $forumperms = $vbulletin->userinfo['forumpermissions']["$forumid"];
                if ((!($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostnew']) AND !$vbulletin->options['showprivateforums']) OR !($vbulletin->forumcache["$forumid"]['options'] & $vbulletin->bf_misc_forumoptions['showonforumjump']) OR !$vbulletin->forumcache["$forumid"]['displayorder'] OR !($vbulletin->forumcache["$forumid"]['options'] & $vbulletin->bf_misc_forumoptions['active']))
                {
                        continue;
                }
                else
                {
                        $forum = $vbulletin->forumcache["$forumid"];

                        $ret.= "<li>";
                        if (!($forum['options'] & $vbulletin->bf_misc_forumoptions['open']))
                        {
                                $ret.= "<span class=\"smallfont\">"." $forum[title_clean]"."</span>";
                        } else {
                                $ret.= "<a class=\"smallfont\" href=\"newthread.php?f=$forumid\">"." $forum[title_clean]</a>";
                        }

                        add_newthread_list($forumid, $ret, $forumperms);
                        $ret.= "</li>";
                } // if can view
        } // end foreach ($vbulletin->iforumcache[$parentid] AS $forumid)
        $ret .= "</ul>";
        return $ret;
}
$adv_portal_newthread = "";
$adv_portal_newthread = add_newthread_list(-1, $adv_portal_newthread);
$adv_portal_newthread = "$adv_portal_newthread";
eval('$home["$mods[modid]"][\'content\'] = "' . fetch_template('adv_portal_newthread') . '";');

UPDATE: Brian was able to point me to the mistake. It's called 'allowposting' instead of 'open'.


All times are GMT. The time now is 07:22 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.01044 seconds
  • Memory Usage 1,722KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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