[DEV] Pafiledb [DOWNLOAD MOD] 0.0.9d

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
Dr. Know Nothin
Registered User
Posts: 218
Joined: Tue Mar 04, 2003 12:59 am

Post by Dr. Know Nothin »

I have the old verion of Hotschi's hack and when I try to download a file, it downloads a load document file instead. And how to I create a .htacess?
Holger
Registered User
Posts: 1843
Joined: Tue Mar 12, 2002 3:54 pm
Location: Hannover

Post by Holger »

Dr. Know Nothin wrote: And how to I create a .htacess?


http://www.javascriptkit.com/howto/htaccess.shtml

:-)
Dr. Know Nothin
Registered User
Posts: 218
Joined: Tue Mar 04, 2003 12:59 am

Post by Dr. Know Nothin »

ok thanks, but what about the problem with the load file. Where when I go to a download, it downloads a load document.
Fearless
Registered User
Posts: 664
Joined: Mon Mar 31, 2003 6:16 am

Post by Fearless »

What is the exact name of the downloaded document ?
Dr. Know Nothin
Registered User
Posts: 218
Joined: Tue Mar 04, 2003 12:59 am

Post by Dr. Know Nothin »

Its just called load.
Holger
Registered User
Posts: 1843
Joined: Tue Mar 12, 2002 3:54 pm
Location: Hannover

Post by Holger »

Dr. Know Nothin wrote: I have the old verion of Hotschi's hack ...


Sorry: this thread is for the pafiledb MOD of Mohd, Hotschies Hack is discussed somewhere else ...

/H
Fearless
Registered User
Posts: 664
Joined: Mon Mar 31, 2003 6:16 am

Post by Fearless »

Dr. Know Nothin wrote: Its just called load.


No file extension at all ? Have you checked what files are present in the upload directory ?
Dr. Know Nothin
Registered User
Posts: 218
Joined: Tue Mar 04, 2003 12:59 am

Post by Dr. Know Nothin »

Sorry: this thread is for the pafiledb MOD of Mohd, Hotschies Hack is discussed somewhere else ...


Probably but the search engine doesn't work well for me.

Well it didnt have an extension and just kept downloading. But now I installed the newer version of the hack, so I can have categories. But there are still errors.

1. When I click on the downloads link, above the file is this error.
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sonicfig/public_html/SFDownloads/phpBB2/downloads.php on line 107


2. When I click on the file I get this error.
Could not query downloads

DEBUG MODE

SQL Error : 1054 Unknown column 'cat' in 'where clause'

SELECT * FROM phpbb_downloads where cat=1 ORDER by sort

Line : 87
File : /home/sonicfig/public_html/SFDownloads/phpBB2/downloads.php


3. When I click on files in the admin panel, at the top I get this:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/sonicfig/public_html/SFDownloads/phpBB2/admin/admin_dl_files.php on line 298


4. When I try to add a file, I get this:
Couldn't update/insert into download table

DEBUG MODE

SQL Error : 1054 Unknown column 'cat' in 'field list'

UPDATE phpbb_downloads SET description = '44', long_desc = 'IT''S LIKE. OM3|-| g0|)', file_name = 'Episode 44/SonicX_44_GTW.rm', free = '0', extern = '0', cat = '1' WHERE id = 3

Line : 181
File : /home/sonicfig/public_html/SFDownloads/phpBB2/admin/admin_dl_files.php
Dr. Know Nothin
Registered User
Posts: 218
Joined: Tue Mar 04, 2003 12:59 am

Post by Dr. Know Nothin »

My Download file
<?php

$download_dir = "media/";

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Set page ID for session management
//
$userdata = session_pagestart($user_ip, PAGE_DOWNLOADS);
init_userprefs($userdata);
//
// End session management
//

//
// Generate page
//
$cat = $_GET["cat"];
$id = $_GET["id"];
$view = $_GET["view"];

make_jumpbox('viewforum.'.$phpEx);

$page_title = $lang['Downloads'];

include($phpbb_root_path . 'includes/page_header.'.$phpEx);

if ($view == "detail")
{
$template->set_filenames(array(
'body' => 'view_dl_body.tpl')
);
}
elseif (!$cat)
{
$template->set_filenames(array(
'body' => 'view_dl_cat_body.tpl')
);
} else
{
$template->set_filenames(array(
'body' => 'downloads_body.tpl')
);
}

$user_id = $userdata['user_id'];
$username = $userdata['username'];
if ( $userdata['session_logged_in'])
{
$user_traffic = $userdata['user_traffic'];
}
else
{
$user_traffic = "0";
}
if ($user_traffic < 1024)
{
$user_traffic_out = $user_traffic . " Bytes";
}
if ($user_traffic > 1023)
{
$user_traffic_out = bcdiv($user_traffic,1024,2) . " kb";
}
if ($user_traffic > 1048575)
{
$user_traffic_out = bcdiv($user_traffic,1048576,2) . " Mb";
}
if ($view == "detail")
{
$sql = "SELECT * FROM " . DOWNLOADS_TABLE . " WHERE id = $id";
}
elseif (!$cat)
{
$sql = "SELECT * FROM " . DL_CAT_TABLE . " ORDER by sort";
} else
{
$sql = "SELECT * FROM " . DOWNLOADS_TABLE . " where cat=".$cat." ORDER by sort";
}



if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query downloads', '', __LINE__, __FILE__, $sql);
}

if ( $row = $db->sql_fetchrow($result) )
{
$i = 0;
do
{
## get the proper path for each cat
if ($row[cat]) {
$sql_cat = "SELECT path,cat_name FROM " . DL_CAT_TABLE . " WHERE id = $row[cat]";
$result_cat = mysql_query($sql_cat);
$data_cat = mysql_fetch_array($result_cat, MYSQL_ASSOC);
$file_path = $data_cat[path];

}
## get the number of files in cat
if (!$cat) {
$sql_cat_count_dl = "SELECT * FROM " . DOWNLOADS_TABLE . " where cat=".$row[id]." ORDER by sort";
$result_count_dl = $db->sql_query($sql_cat_count_dl);
$cat_dl =mysql_num_rows($result_count_dl);
}
$cat_name = $row['cat_name'];
$cat_id = $row['id'];
$cat_desc = $row['description'];
$cat_view = append_sid("downloads.$phpEx?cat=$cat_id");
$u_dl_top = ($cat)? '&nbsp;->&nbsp;<a href="'.append_sid("downloads.$phpEx").'" class="nav">'.$lang['Dl_cat_title'].'</a>&nbsp;' : '';
$u_dl_cat =(!$cat) ? '&nbsp;->&nbsp;<a href="'.append_sid("downloads.$phpEx").'" class="nav">'.$lang['Dl_cat_title'].'</a>&nbsp;' : '&nbsp;->&nbsp;<a href="'.append_sid("downloads.$phpEx?cat=$cat").'" class="nav">'. $data_cat[cat_name].'</a>&nbsp;';
$description = $row['description'];
if ($view == "detail") $long_desc = nl2br($row['long_desc']);
$file_name_name = $row['file_name'];
$file_id = $row['id'];
if ($row['long_desc'] != "") $info = "<a class=\"gen\" href=\"downloads.$phpEx?view=detail&id=" . $file_id . "&cat=" . $row[cat] . "\">" . $lang['Dl_info'] . "</a>";
if ($row['long_desc'] == "") $info = "-";
$file_klicks = $row['klicks'];
$file_free = $row['free'];
$file_extern = $row['extern'];
if ($file_extern == "0") $file_size = filesize($download_dir . $file_path.$file_name_name);
if ($file_size < 1024)
{
$file_size_out = $file_size . " byte";
}
if ($file_size > 1025)
{
$file_size_out = bcdiv($file_size,1024,2) . " kb";
}
if ($file_size > 1048575)
{
$file_size_out = bcdiv($file_size,1048576,2) . " Mb";
}
if ($file_extern == "1") $file_size_out = $lang['Dl_not_availible'];

if ( $userdata['session_logged_in'] AND $user_traffic > $file_size AND $file_extern == "0")
{
$status = "<a href=\"load." . $phpEx . "?id=" . $file_id . "\"><img src=\"" . $images['Dl_yellow'] . "\" border=\"0\" alt=\"" . $lang['Dl_yellow_explain'] . "\"></a>";
$file_name = "<a class=\"gen\" href=\"load." . $phpEx . "?id=" . $file_id . "\">$file_name_name</a>";
}
else
{
$status = "<img src=\"" . $images['Dl_red'] . "\" alt=\"" . $lang['Dl_red_explain'] . "\">";
$file_name = $file_name_name;
}
if ( $file_extern == "1")
{
$status = "<a href=\"load." . $phpEx . "?id=" . $file_id . "\"><img src=\"" . $images['Dl_grey'] . "\" border=\"0\" alt=\"" . $lang['Dl_grey_explain'] . "\"></a>";
$file_name = "<a class=\"gen\" href=\"load." . $phpEx . "?id=" . $file_id . "\">$file_name_name</a>";
}
if ( $file_free == "1")
{
$status = "<a href=\"load." . $phpEx . "?id=" . $file_id . "\"><img src=\"" . $images['Dl_green'] . "\" border=\"0\" alt=\"" . $lang['Dl_green_explain'] . "\">";
$file_name = "<a class=\"gen\" href=\"load." . $phpEx . "?id=" . $file_id . "\">$file_name_name</a>";
}

$template->assign_vars(array(

"U_DL_TOP" => $u_dl_top,
"T_DL_CAT" => ($cat)? $data_cat[cat_name] : $lang['Dl_cat_name'],
"U_DL_CAT" => $u_dl_cat,
"L_ACCOUNT" => $lang['Dl_account'],
"L_DL_PATH" => $lang['Dl_cat_path'],
"L_USERNAME" => $lang['Username'],
"L_TRAFFIC" => $lang['Traffic'],
"L_DL_CAT" => $lang['Dl_cat_name'],
"L_DL_FILES" => $lang['Dl_cat_files'],
"L_STATUS" => $lang['Download_status'],
"L_DOWNLOAD" => $lang['Dl_download'],
"L_SIZE" => $lang['Dl_file_size'],
"L_KLICKS" => $lang['Dl_klicks'],
"L_FILE_NAME" => $lang['Dl_file_name'],
"L_NAME" => $lang['Dl_name'],
"L_I" => $lang['Dl_i'],
"L_DETAILS" => $lang['Dl_detail'],
"GREEN" => $images['Dl_green'],
"RED" => $images['Dl_red'],
"YELLOW" => $images['Dl_yellow'],
"GREY" => $images['Dl_grey'],
"L_DL_GREEN_EXPLAIN" => $lang['Dl_green_explain'],
"L_DL_RED_EXPLAIN" => $lang['Dl_red_explain'],
"L_DL_YELLOW_EXPLAIN" => $lang['Dl_yellow_explain'],
"L_DL_GREY_EXPLAIN" => $lang['Dl_grey_explain'],
"L_DESCRIPTION" => $lang['Dl_file_description'])


);

$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$row_1 = $theme['td_class1'];
$row_2 = $theme['td_class2'];

$template->assign_block_vars('downloads', array(

'U_CAT_VIEW' => $cat_view,
"CAT_NAME" => $cat_name,
"CAT_ID" => $cat_id,
"CAT_DL" => $cat_dl,
"CAT_DESC" => $cat_desc,
'ROW_CLASS' => $row_class,
'ROW_CLASS1' => $row_1,
'ROW_CLASS2' => $row_2,
'DESCRIPTION' => $description,
'LONG_DESC' => $long_desc,
'INFO' => $info,
'STATUS' => $status,
'USER_TRAFFIC' => $user_traffic_out,
'FILE_SIZE' => $file_size_out,
'FILE_KLICKS' => $file_klicks,
'FILE_NAME' => $file_name)
);

$i++;
}
while ( $row = $db->sql_fetchrow($result) );
}

$template->assign_block_vars('userdata', array(

'ROW_1' => $row_1,
'ROW_2' => $row_2,
'USER_TRAFFIC' => $user_traffic_out,
'USER_NAME' => $username)
);


$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>


My admin_dl_file:
<?php

$download_dir = "../media/";

define('IN_PHPBB', 1);

if( !empty($setmodules) )
{
$file = basename(__FILE__);
$module[$lang['Downloads']][$lang['Dl_cat_files']] = "$file";
return;
}


//
// Let's set the root dir for phpBB
//
$phpbb_root_path = "./../";
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);

if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
$mode = ($HTTP_GET_VARS['mode']) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
}
else
{
//
// These could be entered via a form button
//
if( isset($HTTP_POST_VARS['add']) )
{
$mode = "add";
}
else if( isset($HTTP_POST_VARS['save']) )
{
$mode = "save";
}
else
{
$mode = "";
}
}

if( $mode != "" )
{
if( $mode == "edit" || $mode == "add" )
{

//
// They want to add a new download, show the form.
//
$download_id = ( isset($HTTP_GET_VARS['id']) ) ? intval($HTTP_GET_VARS['id']) : 0;

$s_hidden_fields = "";

if( $mode == "edit" )
{
if( empty($download_id) )
{
message_die(GENERAL_MESSAGE, $lang['Must_select_download']);
}

$sql = "SELECT * FROM " . DOWNLOADS_TABLE . "
WHERE id = $download_id";
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't obtain download data", "", __LINE__, __FILE__, $sql);
}

$s_hidden_fields .= '<input type="hidden" name="id" value="' . $download_id . '" />';


if ( $row = $db->sql_fetchrow($result) )
{
$i = 0;
do
{
$description = $row['description'];
$file_name = $row['file_name'];
$cat = $row['cat'];
$long_desc = $row['long_desc'];
if ($row['free'] == "1") $checkfree = "checked";
if ($row['extern'] == "1") $checkextern = "checked";

$dl_edit = append_sid("admin_dl_files.$phpEx?mode=edit&id=$file_id");

$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

$i++;
}
while ( $row = $db->sql_fetchrow($result) );
}

}

$sql_cat = "SELECT id, cat_name FROM " . DL_CAT_TABLE . " ORDER by sort";
$result_cat = $db->sql_query($sql_cat);
while ($arr_cat = mysql_fetch_array($result_cat))
{
$selected = "";
if ($arr_cat[id] == $cat) $selected = " selected";
$select_code .= "<option value=\"" . $arr_cat[id] . "\"$selected>" . $arr_cat[cat_name] . "</option>";
}

$s_hidden_fields .= '<input type="hidden" name="mode" value="save" />';

$template->set_filenames(array(
"body" => "admin/dl_files_edit_body.tpl")
);

$template->assign_vars(array(

"L_DL_FILES_TITLE" => $lang['Dl_files_title'],
"L_DL_FILES_TEXT" => $lang['Dl_files_explain'],
"L_DL_FILE_NAME" => $lang['Dl_file_name'],
"L_DL_NAME" => $lang['Dl_name'],
"L_DL_CAT_NAME" => $lang['Dl_cat_name'],
"L_DL_ORDER" => $lang['Dl_order'],
"L_DL_DESCRIPTION" => $lang['Dl_file_description'],
"L_LINK_URL" => $lang['Dl_files_url'],
"L_LINK_URL_EXPLAIN" => $lang['Dl_files_url_explain'],
"L_FREE_EXPLAIN" => $lang['DL_free_explain'],
"L_DL_IS_FREE" => $lang['Dl_is_free'],
"L_DL_EXTERN" => $lang['Dl_extern'],
"L_DL_EXTERN_EXPLAIN" => $lang['Dl_extern_explain'],
"L_SUBMIT" => $lang['Submit'],
"L_RESET" => $lang['Reset'],
"L_YES" => $lang['Yes'],
"L_NO" => $lang['No'],
"DESCRIPTION" => $description,
"LONG_DESC" => $long_desc,
"FILE_NAME" => $file_name,
"URL" => $file_name,
"CHECKFREE" => $checkfree,
"CHECKEXTERN" => $checkextern,
"SELECT_CAT" => $select_code,

"S_DOWNLOADS_ACTION" => append_sid("admin_dl_files.$phpEx"),
"S_HIDDEN_FIELDS" => $s_hidden_fields)
);

}

else if( $mode == "save" )
{
//
// Ok, they sent us our info, let's update it.
//

$download_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : 0;
$cat_id = ( isset($HTTP_POST_VARS['cat_id']) ) ? intval($HTTP_POST_VARS['cat_id']) : 0;
$description = ( isset($HTTP_POST_VARS['description']) ) ? trim($HTTP_POST_VARS['description']) : "";
$long_desc = ( isset($HTTP_POST_VARS['long_desc']) ) ? trim($HTTP_POST_VARS['long_desc']) : "";
$file_name = ( isset($HTTP_POST_VARS['file_name']) ) ? trim($HTTP_POST_VARS['file_name']) : "";
$file_free_value = ( isset($HTTP_POST_VARS['file_free']) ) ? trim($HTTP_POST_VARS['file_free']) : "";
$file_extern_value = ( isset($HTTP_POST_VARS['file_extern']) ) ? trim($HTTP_POST_VARS['file_extern']) : "";
if ( $file_free_value == "true" ) $file_free = "1";
if ( $file_free_value != "true" ) $file_free = "0";
if ( $file_extern_value == "true" ) $file_extern = "1";
if ( $file_extern_value != "true" ) $file_extern = "0";

if( $download_id )
{
$sql = "UPDATE " . DOWNLOADS_TABLE . "
SET description = '" . str_replace("\'", "''", $description) . "', long_desc = '" . str_replace("\'", "''", $long_desc) . "', file_name = '" . str_replace("\'", "''", $file_name) . "', free = '" . str_replace("\'", "''", $file_free) . "', extern = '" . str_replace("\'", "''", $file_extern) . "', cat = '" . str_replace("\'", "''", $cat_id) . "'
WHERE id = $download_id";

$message = $lang['Download_updated'];
}
else
{
$sql = "INSERT INTO " . DOWNLOADS_TABLE . " (file_name, cat, description, long_desc, free, extern)
VALUES ('" . str_replace("\'", "''", $file_name) . "', '" . str_replace("\'", "''", $cat_id) . "', '" . str_replace("\'", "''", $description) . "', '" . str_replace("\'", "''", $long_desc) . "', '" . str_replace("\'", "''", $file_free) . "', '" . str_replace("\'", "''", $file_extern) . "')";

$message = $lang['Download_added'];
}

if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't update/insert into download table", "", __LINE__, __FILE__, $sql);
}

$message .= "<br /><br />" . sprintf($lang['Click_return_downloadadmin'], "<a href=\"" . append_sid("admin_dl_files.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

message_die(GENERAL_MESSAGE, $message);

}

else if( $mode == "delete" )
{
//
// Ok, they want to delete their downloads
//

if( isset($HTTP_POST_VARS['id']) || isset($HTTP_GET_VARS['id']) )
{
$download_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']);
}
else
{
$download_id = 0;
}

if( $download_id )
{
$sql = "DELETE FROM " . DOWNLOADS_TABLE . "
WHERE id = $download_id";

if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't delete download data", "", __LINE__, __FILE__, $sql);
}

$message = $lang['Download_removed'] . "<br /><br />" . sprintf($lang['Click_return_downloadadmin'], "<a href=\"" . append_sid("admin_dl_files.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

message_die(GENERAL_MESSAGE, $message);

}
else
{
message_die(GENERAL_MESSAGE, $lang['Must_select_download']);
}
}

else if( $mode == "downloads_order" )
{
//
// Change order of downloads in the DB
//
$move = intval($HTTP_GET_VARS['move']);
$download_id = intval($HTTP_GET_VARS['id']);


$sql = "UPDATE " . DOWNLOADS_TABLE . "
SET sort = sort-$move
WHERE id = $download_id";

if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't change downloads order", "", __LINE__, __FILE__, $sql);
}


$sql = "SELECT * FROM " . DOWNLOADS_TABLE;

$sql .= " ORDER BY sort ASC";


if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get list of Categories", "", __LINE__, __FILE__, $sql);
}

$i = 10;
$inc = 10;

while( $row = $db->sql_fetchrow($result) )
{
$sql = "UPDATE " . DOWNLOADS_TABLE . "
SET sort = $i
WHERE id = " . $row[id];
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't update order fields", "", __LINE__, __FILE__, $sql);
}
$i += 10;
}
$mode = "";
}
else
{
message_die(GENERAL_MESSAGE, $lang['Must_select_download']);
}

}
if ( $mode == "" )
{
//
// Show the default page
//

$sql = "SELECT * FROM " . DOWNLOADS_TABLE . " ORDER by sort";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);
}

if ( $row = $db->sql_fetchrow($result) )
{
$i = 0;
do
{
$sql_cat = "SELECT path FROM " . DL_CAT_TABLE . " WHERE id = $row[cat]";

$result_cat = mysql_query($sql_cat);
$data_cat = mysql_fetch_array($result_cat, MYSQL_ASSOC);
$file_path = $data_cat[path];
$description = $row['description'];
$file_name = $row['file_name'];
$file_id = $row['id'];
$file_free = $row['free'];
$file_extern = $row['extern'];
if ($file_free == "0") $file_free_out = $lang['Dl_no'];
if ($file_free == "1") $file_free_out = $lang['Dl_yes'];
if ($file_extern == "0") $file_extern_out = $lang['Dl_no'];
if ($file_extern == "1") $file_extern_out = $lang['Dl_yes'];
$file_klicks = $row['klicks'];
if ($file_extern == "0") $file_size = filesize($download_dir .$file_path.$file_name);
$file_size_kb = bcdiv($file_size,1024,2);
if ($file_extern == "1") $file_size_kb = $lang['Dl_not_availible'];

$dl_edit = append_sid("admin_dl_files.$phpEx?mode=edit&id=$file_id");
$dl_delete = append_sid("admin_dl_files.$phpEx?mode=delete&id=$file_id");

$dl_move_up = "<a href=\"" . append_sid("admin_dl_files.$phpEx?mode=downloads_order&move=15&id=$file_id") . "\">" . $lang['Dl_up'] . "</a>";
$dl_move_down = "<a href=\"" . append_sid("admin_dl_files.$phpEx?mode=downloads_order&move=-15&id=$file_id") . "\">" . $lang['Dl_down'] . "</a>";

$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

$template->assign_block_vars('downloads', array(

'U_FILE_EDIT' => $dl_edit,
'U_FILE_DELETE' => $dl_delete,
'U_DOWNLOAD_MOVE_UP' => $dl_move_up,
'U_DOWNLOAD_MOVE_DOWN' => $dl_move_down,
'ROW_CLASS' => $row_class,
'DESCRIPTION' => $description,
'STATUS' => $status,
'USER_TRAFFIC' => $user_traffic_kb,
'FILE_SIZE' => $file_size_kb,
'FILE_FREE' => $file_free_out,
'FILE_EXTERN' => $file_extern_out,
'FILE_KLICKS' => $file_klicks,
'FILE_NAME' => $file_name)
);

$i++;
}
while ( $row = $db->sql_fetchrow($result) );
}


$template->set_filenames(array(
"body" => "admin/dl_files_body.tpl")
);

$template->assign_vars(array(
"L_DL_FILES_TITLE" => $lang['Dl_files_title'],
"L_DL_FILES_TEXT" => $lang['Dl_files_explain'],
"L_DL_NAME" => $lang['Dl_name'],
"L_DL_FILE_NAME" => $lang['Dl_file_name'],
"L_DL_FILE_SIZE" => $lang['Dl_file_size'],
"L_DL_IS_FREE" => $lang['Dl_is_free'],
"L_DL_EXTERN" => $lang['Dl_extern'],
"L_DL_FILE_KLICKS" => $lang['Dl_klicks'],
"L_EDIT" => $lang['Edit'],
"L_DELETE" => $lang['Delete'],
"L_ADD_DOWNLOAD" => $lang['Add_new_download'],
"L_ACTION" => $lang['Action'],

"S_DOWNLOADS_ACTION" => append_sid("admin_dl_files.$phpEx"))
);

}

$template->pparse("body");

include('./page_footer_admin.'.$phpEx);

?>
Odin-NMA
Registered User
Posts: 63
Joined: Wed Aug 28, 2002 11:18 am
Location: Valhalla
Contact:

Post by Odin-NMA »

Fearless wrote: There are a few bugs in this script (a few typos here and there also) but the admin section should work properly.
Yup, I've gone through some of it and I ended up removing that function, seems to work fine now..
Fearless wrote: As for adding data from an existing pafileDB database (standalone) that's a big question. I've had a look and there's quite a few custom fields in there as well as some extra features such as listing of mirrors for each file.

I've compared the sql dump of both scripts and yes there are several differences, but this would be a nice feature to have in the final release of this mod..so far I've started adding the files manually, takes time but eh....
Fearless wrote: Well, this is the source for all things phpBB ;) . Btw, I like your site. There was a link from BeyondUnreal forums to a news item that was posted about Black Isle studios getting the boot from Interplay.

Thanks man, it's coming together nicely but still alot of work to do.. lots I wanna do and just don't know how to do it..so it ends up with learning these things..
Fearless
Registered User
Posts: 664
Joined: Mon Mar 31, 2003 6:16 am

Post by Fearless »

Dr. Know Nothin wrote: 2. When I click on the file I get this error.
Could not query downloads

DEBUG MODE

SQL Error : 1054 Unknown column 'cat' in 'where clause'

SELECT * FROM phpbb_downloads where cat=1 ORDER by sort

Line : 87
File : /home/sonicfig/public_html/SFDownloads/phpBB2/downloads.php


Missing category column in phpbb_downloads. The table shouldn't be named phpbb_downloads anyway but phpbb_pa_downloads, at least in this version.
Dr. Know Nothin wrote: 4. When I try to add a file, I get this:
Couldn't update/insert into download table

DEBUG MODE

SQL Error : 1054 Unknown column 'cat' in 'field list'

UPDATE phpbb_downloads SET description = '44', long_desc = 'IT''S LIKE. OM3|-| g0|)', file_name = 'Episode 44/SonicX_44_GTW.rm', free = '0', extern = '0', cat = '1' WHERE id = 3

Line : 181
File : /home/sonicfig/public_html/SFDownloads/phpBB2/admin/admin_dl_files.php


ditto.

P.S: Please edit the download file text source out please at it just forces people to scroll and people will probably ignore it. A link to a txt file on an FTP or web site would have been better.
Holger
Registered User
Posts: 1843
Joined: Tue Mar 12, 2002 3:54 pm
Location: Hannover

Post by Holger »

Fearless wrote:
Dr. Know Nothin wrote:2. When I click on the file I get this error.
Could not query downloads

DEBUG MODE

SQL Error : 1054 Unknown column 'cat' in 'where clause'

SELECT * FROM phpbb_downloads where cat=1 ORDER by sort

Line : 87
File : /home/sonicfig/public_html/SFDownloads/phpBB2/downloads.php


Missing category column in phpbb_downloads. The table shouldn't be named phpbb_downloads anyway but phpbb_pa_downloads, at least in this version.
Dr. Know Nothin wrote: 4. When I try to add a file, I get this:
Couldn't update/insert into download table

DEBUG MODE

SQL Error : 1054 Unknown column 'cat' in 'field list'

UPDATE phpbb_downloads SET description = '44', long_desc = 'IT''S LIKE. OM3|-| g0|)', file_name = 'Episode 44/SonicX_44_GTW.rm', free = '0', extern = '0', cat = '1' WHERE id = 3

Line : 181
File : /home/sonicfig/public_html/SFDownloads/phpBB2/admin/admin_dl_files.php


ditto.

P.S: Please edit the download file text source out please at it just forces people to scroll and people will probably ignore it. A link to a txt file on an FTP or web site would have been better.


Hm, Fearless,

don't mix Hotschis download-MOD with Mohds pafiledb MOD!
Before you continue, Dr. Know Nothin, please clarify which mod you are talking about!

/H
Fearless
Registered User
Posts: 664
Joined: Mon Mar 31, 2003 6:16 am

Post by Fearless »

Well, Dr. Know Nothin's clearly stated in his last post that he was ignoring your comment about this thread not being about Hotschis download-MOD :P .

I find that pretty rude myself and I'm just pointing out that his post doesn't make any sense in the context of this thread dedicated to pafileDB integration mod. I hope he comes to his senses and seeks appropriate support elsewhere ;) .
Dr. Know Nothin
Registered User
Posts: 218
Joined: Tue Mar 04, 2003 12:59 am

Post by Dr. Know Nothin »

Well I appologize and wasn't ignoring anyone's post. What I was saying was usually when I search the search engine here I get a page not found or server error. Plus I posted here as a last resort because I've searched many boards even Hotschi's for an answer and have been posting this question for weeks without an answer. :? I'll just look for the topic by the pages if I can.
User avatar
Lucas1510
Registered User
Posts: 47
Joined: Thu Sep 04, 2003 12:07 am
Location: Herne - Germany
Contact:

Post by Lucas1510 »

---deleted---
Last edited by Lucas1510 on Fri Feb 13, 2004 2:56 pm, edited 1 time in total.
Locked

Return to “[2.0.x] MODs in Development”