How do I change the path to the forum? When I click for example "View the Forum" in my newly created Forum Activity block I get redirected to http://www.example.org/drupal/ when it should be http://www.example.org/drupal/forum/.
Clicking on one of the posts I get redirected to http://www.example.org/drupal//showthread.php%3Ft%3D993 where both the path is wrong and they querystring has errors in it.

Thanks,
Patrik

Comments

gein’s picture

I digged into the code and found that it actually checks in the vb database for the correct values. I did some trouble shooting and came up with the fact that it doesn't seem to unserialize the data field. So I found (on php.net) a function for checking if a string is unserializeable and according to that test the string fails on this part:

   $str = 's';
   $array = 'a';
   $integer = 'i';
   $any = '[^}]*?';
   $count = '\d+';
   $content = '"(?:\\\";|.)*?";';
   $open_tag = '\{';
   $close_tag = '\}';
   $parameter = "($str|$array|$integer|$any):($count)" . "(?:[:]($open_tag|$content)|[;])";
   $preg = "/$parameter|($close_tag)/";
   if( !preg_match_all( $preg, $string, $matches ) )
   {
       $errmsg = 'not a serialized string';
       return false;
   }

Is anyone else having this problem? I have tried to copy the options data field once again from the original database but without luck.

gein’s picture

I figured I was wrong when I said the string fails the test. Although I can't even unserialize the simpliest string:

a:1:{s:16:"errorlogsecurity";}

var_dump(unserialize($data->data));

if($options = unserialize($data->data))
echo " OK";
else
echo " ERROR";

Outputs: bool(false) ERROR

I'm out of ideas at the moment.

gein’s picture

I realized that my test string wasn't properly serialized and in the same time I can say I'm not familiar with serialization but I'm starting to understand it :)

So I tried this string instead: a:1:{s:5:"Hello";s:5:"World";}
and I may unserialize it. Although I still cannot unserialize the options row from the vbulletin database. How can I verify the string to figure out why PHP can't unserialize it? Isn't it kind of strange that my vBulletin forum is able to (un)serialize it?

JStarcher’s picture

Well I'm not sure what exactly you are trying to unserialize, but here is a quick example on unserializing a vBulletin mysql query:

$touserarray = $vbulletin->db->query("SELECT touserarray FROM pmtext;");
                        $row = mysql_fetch_object($touserarray);
			$touserarray_unserial = unserialize($row->touserarray);
                        echo $touserarray_unserial['1'];

That code will read the serialized data in table pmtext, column touserarray and unserialize it. The echo will echo the username of userid=1, is someone has sent them a pm (otherwise it wouldn't exist). You can change the 1 to whatever userid you want and it will show you the username.

That might help you.

gein’s picture

Thanks TheOverclocked,
Still can't get it to work though. I'm trying to unserialize the row where title = options in the datastore table in the vB database.
The code is more or less from the original drupalvb (drupalvb.inc.php):

 $result = db_query(_drupalvb_prefix("SELECT data FROM {datastore} WHERE title = 'options'"));
  $data = db_fetch_object($result);

    var_dump(unserialize($data->data));

    if($options = unserialize($data->data))
        echo " OK";
    else
        echo " ERROR";

This prints "ERROR".
I just want the module to work ;)

leon83’s picture

I did it manually at my site about Dota Allstars.

1) open drupalvb.inc.php
2) change function _drupalvb_vb_init

$vbulletin->options['bburl'] = 'http://www.dotapick.ru/forum/'; //use your string!
return $vbulletin;

Standart parametres from forum don't work :(

lexx27’s picture

What exactly did you do there? Where did you put the manual pat?

sun’s picture

Status: Active » Fixed

Drupalvb 5.x-2.x implements a completely overhauled database interface to vBulletin now. A development snapshot should be available within the next 12 hours. A first release candidate will follow in the next days.

kasalla’s picture

Same issue here...
I´ve tested it with rc3 and 2.x-dev...

sun’s picture

@anstosser: Please create a new issue. This one contains too much unrelated information.

kasalla’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.