PDA

View Full Version : rewrite 3.0.3 code to 3.8.2


ageurtse
05-01-2009, 06:08 PM
Hello i have a php file on an old forum 3.0.3 and i wan't to upgrade the forum to 3.8.2 but on the testing server the php file won't run.

i searched a bit, but in 3.8.2 there is no
/globalize($_REQUEST, array('perpage' => INT, 'pagenumber' => INT, 'showthumbs' => INT, 'userid' => INT));how can i solve this first problem.

below the whole code is there.

edit by Lynne: code removed

ageurtse
05-03-2009, 10:37 AM
nobady who could help me with this

ForumsMods
05-03-2009, 02:25 PM
I saw in you thread that you are doing it. Now, I am busy doing some jobs, when I finish I will help you. Or if you are hurry, you can post in Requests For Paid Services (https://vborg.vbsupport.ru/forumdisplay.php?f=30)

Change $DB_site to $db

ageurtse
05-03-2009, 05:20 PM
i hade do some rewriting already done ,the $db_site i translated in stuf i translated $vbulletin->db.

$post do i need to translate that ?

Lynne
05-03-2009, 05:40 PM
Is this code you wrote yourself? If not, you can't post it here without permission from the author.

ageurtse
05-03-2009, 05:53 PM
i wish i had write this peace of code.
the code is i think from here https://vborg.vbsupport.ru/showthread.php?t=68419

i found this gallery file on the server i currently administrate.

the author i can't reach his website is out of order.

what could i do next to contact him ?

when it is still "illigal" then this thread should be closed and removed :(

Lynne
05-03-2009, 05:58 PM
I removed the code from the first post.

It is fine if you want to hire someone to change the code for use on your own site, but since the author didn't give permission for the code to be 'reused' or for you to post it anywhere, then you can't just post the code here. The coder hasn't been here for over eight months, so I'm guessing he isn't going to be checking for PMs here.

ageurtse
05-04-2009, 04:43 PM
what is wrong with this peace of code

$sorturl = "gallery.php?&userid=$userid&pp=$perpage&showthumbs =$showthumbs";
$pagenav = construct_page_nav($totalattachments, $sorturl);


$totalattachments is a integer number.
i'm thinking of what arguments are missing.

i get two errors.
Warning: Missing argument 3 for construct_page_nav() in [path]/includes/functions.php on line 2410

Warning: Missing argument 4 for construct_page_nav() in [path]/includes/functions.php on line 2410

Lynne
05-04-2009, 05:01 PM
Take a look at the API for construct_page_nav. You need 4 arguments. http://members.vbulletin.com/api/

ageurtse
05-04-2009, 05:09 PM
thanks lynne, i bookmarked it.

is the code from 3.7.x the same as 3.8.x ?

--------------- Added 1241462539 at 1241462539 ---------------

what do $show en $post mean, i can't find a manual about these 2 things

Lynne
05-04-2009, 06:24 PM
What do they *mean*? They are just variable names. You can name results anything you want. In vbulletin code, $show is in general used as the variable to determine if something should be shown or not, and $post is in general used for post results.

ageurtse
05-04-2009, 07:28 PM
When will the code be displayed after construct_page_nav is called.

i think i have rewritten the code i early posted and it run's fine, no errors.
But there are no attachments there is only the page header, navbar and footer.
but inbetween where the attachments should be there is nothing ?

what could be wrong ?

Lynne
05-04-2009, 07:55 PM
I have no idea because I don't know anything about the code.

ageurtse
05-06-2009, 04:23 PM
i have te script running on 3.8.2 but i left some part's out becaus i don't get them to work.

one of them is this peace of code
foreach ($vbulletin->userinfo['forumpermissions'] AS $vbulletin->foruminfo[forumid] => $perm)
{
if (($perm & CANVIEW))
{
$forumids .= ','.$vbulletin->foruminfo[forumid];
}
}

what is wrong, Canview does that exicst ?

Lynne
05-06-2009, 05:40 PM
Try doing a search in other vb pages (use a text editor that will search all pages in a folder/directory) for similar code in vb and see what code is used. For instance, I think forumpermissions are usually attached to a forumid now, ie ['forumpermission']['some_forumid'] . So, you'll probably have to play with the code a bit.

edit: OK, I did find a couple of places where that isn't so. Do a search for "$vbulletin->userinfo['forumpermissions']" and you'll find some examples of 3.8 code that is similar to what you have there.