![]() |
forums problems please help
im tring to get other conditions to forums and i got little problem
i copied part of code from forum.php (admincp dir) any way i have tried to do something like : PHP Code:
PHP Code:
on forum.php this query works fine so what might be the problem ? please help... |
Well, $forum in forum.php is not initialized using fetch_foruminfo().
Better use PHP Code:
|
line 86 :
PHP Code:
only from other script then f.php so any other idea ? |
You are right that forum.php does use fetch_foruminfo(), but array $forum in the handler for do=update consists only of certain keys of this array (defined by the forum constructed in the handler for do=add/edit).
And that's the point: If you use the array returned by fetch_foruminfo() directly it will contain keys that do not exist as columns in table forum, which causes problems in fetch_query_sql() as it will just use all keys in the given array to construct the query. |
Quote:
i want to do=edit its will give me alll forumid=3 options and i will change what i want and $_Post['do'] = update same forum.php is doing only from another script thats why i used fetch_foruminfo() to get the info same as forum.php does got my point ? |
Yes, I do understand what you want.
But you can't use the array returned by fetch_foruminfo() as input for fetch_query_sql() directly, as it does contain additional keys :) What exactly do you want to change? |
so how would i get allowbbcode and allowhtml and other ++++ that forum info contains ?
i want to be able to edit this options and to update them but not from forum.php...? |
hmm ok, ill try to explain some more
as part of my next version to my team hack i want every team to have a privte forum so i add teamid to forum table deafult is 0 if teamid = 0 means that forum is regular forum if teamid !=0 means its privte forum that belong to some team, now i allredy did most of file edits so on forum edit via forum.php you wont see forums that their teamid!=0 now im making a script that will make same options to all of forums that their teamid !=0 so if ill do allow html its will edit all forums that their teamid !=0 so i made a while loop for update the only problem atm is to update the info.. same as forum.php does i copied most of the code from their (the code that used in edit) also readed it few times and i still cant find the problem. why its not get updated so i decided to first make a static forum - with out the while loop (forumid : 3) but on forum i cant update the info... thats why im tring only to read the info and update it to the rest i can take care... |
*** Untested ***
PHP Code:
Quote:
Don't forget to call build_forum_permissions() afterwards. |
hmm
few qustion : 1. what the function array_intersect_key() should do ? 2. why to use PHP Code:
3. why did you added 256 to options on db ? btw thank you very much for helping me out |
1. array_intersect_key() creates the intersect of n arrays, eg. an array containing the values from array1 whose keys are present in all other arrays
2. Well, in an external script you don't have $options ... (or I am completely misunderstanding you) 3. 256 = 9th bit = allow HTML as defined in init.php |
ok you got me wrong
i want to do new file f3.php forumid = 3 so when i click on edit i get all of forum options same as on forum.php only here forumid is defined so i copy the things i wanted like PHP Code:
$_POST['do'] = 'update' and on that i got PHP Code:
hmm got me now ? |
Aaaah :)
So actually you are cloning forum.php but restricted to certain forums. So why do you use $forum = fetch_foruminfo()? $forum will be defined by the form in add/edit. |
can it be that im stupid ?
damnn your right... thank you very much mate i will report on progress damnn i still dont understand how i didnt saw it thanx MiZ :) |
1 more qustion ...
does build_forum_permissions(); affect all forums ? cuse after i use the clone script i need to go to my other forums via forum.php and do edit and update or its wont show them not on index and on forumdisplay im getting no premission error... |
Yes it does affect all forums.
|
so its ++++ing something up... cuse in order to see other forums i need to do rebuild forum information via Update Counters on admin cp
and idea what might be the problem ? |
nvm
build_forum_permissions(); was inside the while loop and thats what ++++ed the things up thank u very much for help :) |
All times are GMT. The time now is 04:48 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|