PDA

View Full Version : Hacking vB 3.5.0


Logikos
06-09-2005, 06:19 PM
Since there is no way to add a hook to the "/admincp/ ". I have no choice to hack the admincp/forum.php file to show the option. So i'm going to use this:


print_input_row($vbphrase['forum_home_icon'], 'forum[forumhomeicon]', $forum['forumhomeicon']);


But i can't figure out how to define 'forumhomeicon'. Thats the row name in the forum table. So i get this error:


Fatal error: Field forumhomeicon is not defined in $validfields in class vb_datamanager_forum in \includes\class_dm.php on line 484


Any ideas?

eXtremeTim
06-09-2005, 06:24 PM
Some info on this datamanager would be nice. :-/ I mean they tell us some nice ++++ about this datamananger and now its out yet I have no clue how to work with it.

Brad
06-09-2005, 06:25 PM
Since there is no way to add a hook to the "/admincp/ ". I have no choice to hack the admincp/forum.php file to show the option. So i'm going to use this:


print_input_row($vbphrase['forum_home_icon'], 'forum[forumhomeicon]', $forum['forumhomeicon']);


But i can't figure out how to define 'forumhomeicon'. Thats the row name in the forum table. So i get this error:



Any ideas?
Open /includes/class_dm_forum.php

Find:

var $validfields = array(
'forumid' => array(TYPE_UINT, REQ_INCR, VF_METHOD, 'verify_nonzero'),
'styleid' => array(TYPE_INT, REQ_NO, 'if ($data < 0) { $data = 0; } return true;'),
'title' => array(TYPE_STR, REQ_YES, VF_METHOD),
'description' => array(TYPE_STR, REQ_NO, '$data = convert_to_valid_html($data); return true;'),
'options' => array(TYPE_ARRAY_BOOL, REQ_AUTO),
'displayorder' => array(TYPE_UINT, REQ_NO),
'replycount' => array(TYPE_UINT, REQ_NO),
'lastpost' => array(TYPE_UINT, REQ_NO),
'lastposter' => array(TYPE_STR, REQ_NO),
'lastthread' => array(TYPE_STR, REQ_NO),
'lastthreadid' => array(TYPE_UINT, REQ_NO),
'lasticonid' => array(TYPE_UINT, REQ_NO),
'threadcount' => array(TYPE_UINT, REQ_NO),
'daysprune' => array(TYPE_INT, REQ_AUTO, 'if ($data == 0) { $data = -1; } return true;'),
'newpostemail' => array(TYPE_STR, REQ_NO, VF_METHOD, 'verify_emaillist'),
'newthreademail' => array(TYPE_STR, REQ_NO, VF_METHOD, 'verify_emaillist'),
'parentid' => array(TYPE_INT, REQ_YES, VF_METHOD),
'password' => array(TYPE_NOTRIM, REQ_NO),
'link' => array(TYPE_STR, REQ_NO), // do not use verify_link on this -- relative redirects are prefectly valid
'parentlist' => array(TYPE_STR, REQ_AUTO, 'return preg_match(\'#^(\d+,)*-1$#\', $data);'),
'childlist' => array(TYPE_STR, REQ_AUTO)
);

You need to add forumhomeicon to that list :)

Logikos
06-09-2005, 06:26 PM
** HUGS BRAD ** :p Your my hero...

Andreas
06-09-2005, 06:27 PM
The Forum Manager uses the Forum Datamanager to handle data from table forum and make sure that everything is correct.
But the datamanager does not know anyting about 'forumhomeicon'.
Therefor you get this error.

Although you can edit class_dm_form.php, the preferred way is doing this via a plugin:

hookname = forumdata_start

$this->validfields['forumhomeicon'] = array(TYPE_STR, REQ_NO);

Brad
06-09-2005, 06:49 PM
As noted by Mike you can add fields with the forumdata_start hook :)

http://www.vbulletin.com/forum/showthread.php?t=142055

Logikos
06-09-2005, 07:04 PM
The Forum Manager uses the Forum Datamanager to handle data from table forum and make sure that everything is correct.
But the datamanager does not know anyting about 'forumhomeicon'.
Therefor you get this error.

Although you can edit class_dm_form.php, the preferred way is doing this via a plugin:

hookname = forumdata_start

$validfields['forumhomeicon'] = array(TYPE_STR, REQ_NO);

I did what you said, and i get this Fatal error: Field forumhomeicon is not defined in $validfields in class vb_datamanager_forum in \includes\class_dm.php on line 484.

Andreas
06-09-2005, 07:13 PM
Post updated ;)

Brad
06-09-2005, 07:14 PM
Post updated ;)
Damn $this-> gets me every time to ;)

Logikos
06-09-2005, 07:16 PM
Thanks guys, updated my post in the hack forum now! :)

deathemperor
06-10-2005, 04:25 AM
so generally we will still have to modify the vb code ? I thought that's changed ?