Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-04-2012, 10:23 AM
blade x is offline blade x
Registered User

Join Date: Aug 2012
Posts: 3

phpuploader to use phpbb session tables

Hi

I would like to say what a cool addon to any forum software this is i have searched high and low for an uploader that gives a link to the selected uploaded file/image.

Now lets get right to it

i dont want to use the password feature as i really thinks it sux as the password could be handed out to any one (forum members pass it on to friends)

so the solution is to create a custom page using phpbb and then insert your script in to the html file (for phpbb custom page)

now the down fall is your script will not run from a html file

so the solution is to make a index1.php and place the below code in it (it will check if the user is logged in and if not force them to login to phpbb)

the below snipp needs a html file
once you get passed the phpbb's login box your pushed to the upload box


PHP Code:
<?php
define
('IN_PHPBB'true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH './';
$phpEx substr(strrchr(__FILE__'.'), 1);
include(
$phpbb_root_path 'common.' $phpEx);

//Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
if (
$user->data['user_id'] == ANONYMOUS)
{
    
login_box(''$user->lang['LOGIN']);

page_header('Title Here');

$template->set_filenames(array(
    
'body' => 'dummy_body.html',
));

ob_start();

include(
'upload.php');

$template->assign_var('CONTENT'ob_get_clean());

page_footer();
?>
so now we need a html file so we make a dummy_body.html file and place it in the right location using the code below
PHP Code:
<!-- INCLUDE overall_header.html -->

{
CONTENT}

<!-- INCLUDE 
overall_footer.html --> 
and now for your script in a .php file

it works but it pulls the forum page all to the left and looks a mess

so the question is how can this snippet below be worked in to your script without the need for a html file that in turn would stop the forums theme being used and with out breaking the uploader ?

PHP Code:
<?php
define
('IN_PHPBB'true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH './';
$phpEx substr(strrchr(__FILE__'.'), 1);
include(
$phpbb_root_path 'common.' $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
if (
$user->data['user_id'] == ANONYMOUS)
{
    
login_box(''$user->lang['LOGIN']);


page_header('Title Here');

$template->set_filenames(array(
    
'body' => 'yourpage_body.html',
));

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>
Reply With Quote
  #2  
Old 08-08-2012, 03:18 PM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,919

I think the easiest thing to do is to just integrate the phpbb sessions into the phuploader.php file and if they aren't logged in, redirect them to the phpbb login. Sort of like you already have it. You could also make the script look like your forums by modifying the actual HTML within the phUploader.php script. Although it would be static..
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #3  
Old 08-14-2012, 07:13 PM
blade x is offline blade x
Registered User

Join Date: Aug 2012
Posts: 3

Done i went your first way as its only one file and every thing works well
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:27 AM.




Powered by vBulletin®