vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Integration with vBulletin - Complete Wordpress/Vbulletin Bridge - Share Users And Postings (https://vborg.vbsupport.ru/showthread.php?t=134521)

lunitius 05-22-2007 02:59 AM

This is my first stab at creating the modification I was asking for in my previous post. Basically I want the "select" box that is visible on the "write" page for wordpress to offer some more usability:

1. I wanted it to be larger (easy enough)
2. I wanted it to show the relationships between my top-level forums (Categories), my second level forums (Forums) and my third level forums (Sub-Forums) so that I could make intelligent decisions about which "forum" i wanted my post to be in.

Here is the modification. It is pretty raw right now but functional. I am working to factor it out to something a little more friendly to anyone by using the various api calls and variables presented from VB. Once I get the next cut done which should include these "upgrades" I will post it as well.

I attached a picture of what this looks like as well so you can get an idea of what I am talking about in case I am not explaining it clearly. See the attachments.

If you have any thoughts on how to do this better or more efficiently please let me know. I am decent coder but struggle with arrays:

This is a context diff of vbbridge.php
Code:


[root@abbadon plugins]# diff -b -B -c vbbridge.php.orig vbbridge.php
*** vbbridge.php.orig  Sun May 20 23:15:23 2007
--- vbbridge.php        Mon May 21 22:47:32 2007
***************
*** 421,440 ****
  function VB_Post_Form () {
  if (get_option('vbb_VBPOST')) {
  ?>
! <CENTER> Select Forum To Post To: <BR><select id="forumid" name="forumid" class="inputbox" size="5" >
!
  <?php
  $wpdb =& $GLOBALS['wpdb'];
- $sql = "SELECT forumid, title FROM " . get_option('vbb_VBPRX') . "forum order by displayorder";
- $results = $wpdb->get_results($sql);
 
 
! foreach ($results as $forum) {
! if ($forum->forumid == get_option('vbb_VBFID')) { $selector = ' selected'; } else { $selector = ''; }
! echo "<option value=$forum->forumid$selector>$forum->title</option>\n";
  }
-
  ?>
  </select>
  <BR>
  Or
--- 421,491 ----
  function VB_Post_Form () {
  if (get_option('vbb_VBPOST')) {
  ?>
! <!-- BEGIN EDIT BY ISI -->
! <CENTER> Select Forum To Post To: <BR><select id="forumid" name="forumid" class="inputbox" size="20" >
  <?php
  $wpdb =& $GLOBALS['wpdb'];
 
+ // connect to db (i couldn't figure out how to get this to work with the vbulletin api)
+ $conn = mysql_connect("localhost","dden","Oicu812");
+ mysql_select_db("dden_blog", $conn);
+
+ // create an array to keep track of what has been printed so we don't do it more than once
+ $printed = array();
+
+ // Get all top level (no parent) forums
+ $results = mysql_query("SELECT forumid, title, childlist FROM " . get_option('vbb_VBPRX') . "forum where parentid = '-1'");
+ while ($row = mysql_fetch_array($results, MYSQL_ASSOC))
+ {
+    // Check to see if the forumid has already been printed.
+    // If not print it and add it to the array of printed forumid to prevent duplicates
+    if (!array_search($row['forumid'], $printed))
+    {
+        echo "<option value=$row[forumid]>$row[title]</option>\n";
+        array_push($printed, $row['forumid']);
+    }
+
+    // Get the forumid and title of the children of the top level
+    $childlist = explode(",", $row['childlist']);
+    foreach ($childlist as $child1)
+    {
+        if ($child1 != $row['forumid'])
+        {
+            $child1_results = mysql_query("SELECT forumid, title, childlist FROM " . get_option('vbb_VBPRX') . "forum where forumid = '$child1'", $conn);
+            while ($child1_row = mysql_fetch_assoc($child1_results))
+            {
+                  // Check to see if the forumid has already been printed.
+                  // If not print it and add it to the array of printed forumid to prevent duplicates
+                if (!array_search($child1_row['forumid'], $printed))
+                {
+                    print "<option value=$child1_row[forumid]>--> $child1_row[title]</option>\n";
+                    array_push($printed, $child1_row['forumid']);
+                }
+
+                // Get the forumid and title of the children of the first level for forum
+                $childlist2 = explode(",", $child1_row['childlist']);
+                foreach ($childlist2 as $child2)
+                {
+                    if ($child2 != $child1_row['forumid'])
+                    {
+                        $child2_results = mysql_query("SELECT forumid, title, childlist FROM " . get_option('vbb_VBPRX') . "forum where forumid = '$child2'", $conn);
+                        while ($child2_row = mysql_fetch_assoc($child2_results))
+                        {
+                            if (!array_search($child2_row['forumid'], $printed))
+                            {
+                                print "<option value=$child2_row[forumid]>&nbsp; &nbsp;----> $child2_row[title]</option>\n";
+                                array_push($printed, $child2_row['forumid']);
+                            }
+                        }
+                    }
+                }
+            }
+        }
 
!    }
  }
  ?>
+ <!-- END EDIT BY ISI -->
  </select>
  <BR>
  Or


Suggestions and comments welcome.

-- Isi

Ramsesx 05-24-2007 08:38 AM

Anybody can help me please, I mapped a special usergroup to authors, but they can't post because the error "you don't have enough permissions to acces this site".
In the wp acp the users are marked as authors. As Administrator I can write a post.
Thanks

Ok, I get it, it is necessary to assign the user rights again on /wp-admin/users.php manually.

dpatel304 05-27-2007 06:55 PM

Quote:

Fatal error: Undefined class name 'vbulletinhook' in /home/dpatel/public_html/forums/includes/class_bbcode.php on line 2347
For some reason, randomly, I am getting this error. It is only showing on my wordpress page, and makes it currently unusable. Forums are working just fine.

I made no changes to the site. The mod was working fine, as were both my blog and forums. It seems to have just occured randomly. I'm thinking it may have something to do with insufficient bandwidth.

Parm 06-05-2007 11:10 AM

Hi all,

I seem to be running into a lot of trouble when installing this plugin. I am new to vBulletin however and this is the first mod that I've tried to install.

I followed the readme exactly and it looked as though everything was working. I made the test post and it worked great. However, soon after that I was unable to access my WP admin page and kept getting a "You do not have sufficient permissions to access this page" message. Deleting the plugin has allowed me back into WP but I can't seem to get it working, each time I reinstall I get the same.

I'm not particularly interested in the mapping of users feature. I just want the option for a thread to be made automatically on the forums when a WP article is posted, the comments link to redirect to it and that's about it. If somebody could talk me through the installation it'd be greatly appreciated. I'm available on MSN if anybody has a moment?

Thanks,
Parm

Jafo232 06-05-2007 03:04 PM

Mapping is required, which is why you cannot login.

Parm 06-05-2007 03:51 PM

Thanks for the update Jafo. When I first installed the plugin, on the mapping options page I chose not to map any of the users and I think that's what is now causing me problems.

How do I go about undoing what I've already done? I've tried removing and reinstalling the plugin but I can no longer get to the options page without being locked out of wordpress.

cleck673 06-07-2007 06:09 PM

A got a couple questions:

a. Is it possible to hard code the blog commenting forum choice into every post without having to select it. When we post using windows live writer, it doesn't create the comment thread.

b. I do not want to use user bridge, just commenting. Any suggestions?

Guest201202001 06-13-2007 12:29 AM

I Installed this one and I made post to see if this one works till here everything Ok.. when I go to: Turn Auto-Integrate On: YES I can't log into the wordpress any more i am redirected at my index page.. I want to tell sth. my forum is on root so www.mysite.com and wordpress www.mysite.com/wordpress

at Forum Relative Path: I don't write anything because i don't know what to writw after all I try to replace the:
Code:

chdir($_SERVER['DOCUMENT_ROOT'] . get_option('vbb_VBRPATH'));
with:
Code:

chdir('/myabsolute path');
but the same thing.. So any idea because need this one

Jafo232 06-13-2007 01:23 AM

Please read the directions. From now on, I am not answering these "I cannot login to wordpress, I am redirected to the forum login". If you read the directions, you would understand why you are being redirected.

Guest201202001 06-13-2007 01:26 AM

Quote:

Originally Posted by Jafo232 (Post 1267305)
Please read the directions. From now on, I am not answering these "I cannot login to wordpress, I am redirected to the forum login". If you read the directions, you would understand why you are being redirected.

So can you tell me why.. I tried o lot of times..


All times are GMT. The time now is 10:58 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.03241 seconds
  • Memory Usage 1,765KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete