This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

Remove "File Attachments" from news


avatar
error 232
From: -
Remove "File Attachments" from news

How to remove File Attachments fields from the bottom of news editor?

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


1 Re: Remove "File Attachments" from news
avatar
Editor
0
From: -
You need to remove the following from /cadmin/news/adminaddnewsstory.php:

    echo "<br /><br /><h2>" . $words_news[ 'FILE_ATTACHMENTS' ] . "</h2>";
$html -> tableheader( "","" );
$query = $database -> dbquery( "SELECT newsfile_id, newsfile_filename, newsfile_title, newsfile_description, newsfile_mime FROM " . DB_PREFIX . "esselbach_ct_newsfiles WHERE newsfile_author = '$login_username' AND newsfile_inuse = '0' ORDER BY newsfile_date DESC" );

while( list( $newsfile_id, $newsfile_filename, $newsfile_title, $newsfile_description, $newsfile_mime ) = $database -> dbrow( $query ) )
{
if( $preferences[ 'news_wysiwyg' ] )
{
if( ( $newsfile_mime == "image/pjpeg" ) or( $newsfile_mime == "image/jpeg" ) or( $newsfile_mime == "image/gif" ) or( $newsfile_mime == "image/png" ) )
{
if( function_exists( "imagecopyresized" ) )
{
$mid_link = "<a href=\"javascript:wysiwyginsert('input_newsstory_story','[thumb=" . $newsfile_id . "]')\"><img src=\"index.php?action=newsattachmentpreview&amp;input_fileid=" . $newsfile_id . "\" title=\"" . htmlspecialchars( $newsfile_description ) . "\" alt=\"" . htmlspecialchars( $newsfile_filename ) . "\" /></a><br />";
}
else
{
$mid_link = "<a href=\"javascript:wysiwyginsert('input_newsstory_story','[thumb=" . $newsfile_id . "]')\">" . htmlspecialchars( $newsfile_filename ) . "</a><br />";
}

$mid_link .= "[ <a href=\"javascript:wysiwyginsert('input_newsstory_story','[fullimage=" . $newsfile_id . "]')\">" . $words_news[ 'ADD_AS_FULL_IMAGE' ] . "</a> | <a href=\"javascript:wysiwyginsert('input_newsstory_story','[thumb=" . $newsfile_id . "]')\">" . $words_news[ 'ADD_AS_THUMBNAIL' ] . "</a> ";
$mid_link .= "| <a href=\"javascript:wysiwyginsert('input_newsstory_extendedstory','[fullimage=" . $newsfile_id . "]')\">" . $words_news[ 'ADD_AS_FULL_IMAGE_EXTENDED' ] . "</a> | <a href=\"javascript:wysiwyginsert('input_newsstory_extendedstory','[thumb=" . $newsfile_id . "]')\">" . $words_news[ 'ADD_AS_THUMBNAIL_EXTENDED' ] . "</a> ]<br />";
}
else
{
$mid_link = "[ <a href=\"javascript:wysiwyginsert('input_newsstory_story','[attachment=" . $newsfile_id . "]Download" . htmlspecialchars( $newsfile_filename ) . "[/attachment]')\">" . $words_news[ 'ADD_DOWNLOAD' ] . "</a> | <a href=\"javascript:wysiwyginsert('input_newsstory_extendedstory','[attachment=" . $newsfile_id . "]Download" . htmlspecialchars( $newsfile_filename ) . "[/attachment]')\">" . $words_news[ 'ADD_DOWNLOAD_EXTENDED' ] . "</a>]<br />";
}
}
else
{
if( ( $newsfile_mime == "image/pjpeg" ) or( $newsfile_mime == "image/jpeg" ) or( $newsfile_mime == "image/gif" ) or( $newsfile_mime == "image/png" ) )
{
if( function_exists( "imagecopyresized" ) )
{
$mid_link = "<a href=\"javascript:insert('[thumb=" . $newsfile_id . "]')\"><img src=\"index.php?action=newsattachmentpreview&amp;input_fileid=" . $newsfile_id . "\" title=\"" . htmlspecialchars( $newsfile_description ) . "\" alt=\"" . htmlspecialchars( $newsfile_filename ) . "\" /></a><br />";
}
else
{
$mid_link = "<a href=\"javascript:insert('[thumb=" . $newsfile_id . "]')\">" . htmlspecialchars( $newsfile_filename ) . "</a><br />";
}

$mid_link .= "[ <a href=\"javascript:insert('[fullimage=" . $newsfile_id . "]')\">" . $words_news[ 'ADD_AS_FULL_IMAGE' ] . "</a> | <a href=\"javascript:insert('[thumb=" . $newsfile_id . "]')\">" . $words_news[ 'ADD_AS_THUMBNAIL' ] . "</a> ";
$mid_link .= "| <a href=\"javascript:insert2('[fullimage=" . $newsfile_id . "]')\">" . $words_news[ 'ADD_AS_FULL_IMAGE_EXTENDED' ] . "</a> | <a href=\"javascript:insert2('[thumb=" . $newsfile_id . "]')\">" . $words_news[ 'ADD_AS_THUMBNAIL_EXTENDED' ] . "</a> ]<br />";
}
else
{
$mid_link = "[ <a href=\"javascript:insert('[attachment=" . $newsfile_id . "]Download" . htmlspecialchars( $newsfile_filename ) . "[/attachment]')\">" . $words_news[ 'ADD_DOWNLOAD' ] . "</a> | <a href=\"javascript:insert2('[attachment=" . $newsfile_id . "]Download" . htmlspecialchars( $newsfile_filename ). "[/attachment]')\">" . $words_news[ 'ADD_DOWNLOAD_EXTENDED' ] . "</a>]<br />";
}
}

if( $input_file == $newsfile_id )
{
$mid_link .= "<textarea cols=\"80\" name=\"input_edittitle\" rows=\"1\" style=\"margin:0px;width:600px\">" . htmlspecialchars( $newsfile_title ) . "</textarea><br />";
$mid_link .= "<textarea cols=\"80\" name=\"input_editdescription\" rows=\"2\" style=\"margin:0px;width:600px\">" . htmlspecialchars( $newsfile_description ) . "</textarea><br />";
$mid_link .= "<input type=\"hidden\" name=\"input_editid\" value=\"" . $newsfile_id . "\" /><input type=\"submit\" name=\"input_doeditfile\" value=\"" . $words_news[ 'GO' ] . "\" /><br />";
}
else
{
$mid_link .= "<strong>" . htmlspecialchars( $newsfile_title ) . "</strong><br />" . htmlspecialchars( $newsfile_description );
}

if( $input_file != $newsfile_id )
{
$html -> tableamiddle( $newsfile_filename, $mid_link, "input_dofileedit", $words_news[ 'EDIT_FILE' ] . $newsfile_id, "input_dofileremove", $words_news[ 'REMOVE_FILE' ] . $newsfile_id );
}
else
{
$html -> tableamiddle( $newsfile_filename, $mid_link, "input_dofileedit", 0, 0, 0, 0 );
}
}

$html -> maketablefooter();
echo "<a href=\"javascript:files_win()\">" . $words_news[ 'SEARCH_FILE_ATTACHMENTS' ] . "</a><br /><br />";

for( $a = 0; $a < 6; $a++ )
{
if( !isset( $input_file_title[ $a ] ) )
{
$input_file_title[ $a ] = "";
}

if( !isset( $input_file_description[ $a ] ) )
{
$input_file_description[ $a ] = "";
}
}

echo "<strong>" . $words_news[ 'FILE' ] . ":</strong><br /><input type=\"file\" name=\"input_file[0]\" /><br />";
$html -> upperform( $words_news[ 'TITLE' ], "input_file_title[0]", $input_file_title[ 0 ], 1 );
$html -> upperform( $words_news[ 'DESCRIPTION' ], "input_file_description[0]", $input_file_description[ 0 ], 2 );
echo "<div id=\"attachment_form_close\"><br /><a href=\"#\" onclick=\"show_form2(); return false;\">" . $words_news[ 'ATTACH_MULTIPLE_FILES' ] . "</a><br /><br /></div>";
echo "<div id=\"attachment_form_open\" style=\"display:none\">";
echo "<strong>" . $words_news[ 'FILE' ] . ":</strong><br /><input type=\"file\" name=\"input_file[1]\" /><br />";
$html -> upperform( $words_news[ 'TITLE' ], "input_file_title[1]", $input_file_title[ 1 ], 1 );
$html -> upperform( $words_news[ 'DESCRIPTION' ], "input_file_description[1]", $input_file_description[ 1 ], 2 );
echo "<br /><strong>" . $words_news[ 'FILE' ] . ":</strong><br /><input type=\"file\" name=\"input_file[2]\" /><br />";
$html -> upperform( $words_news[ 'TITLE' ], "input_file_title[2]", $input_file_title[ 2 ], 1 );
$html -> upperform( $words_news[ 'DESCRIPTION' ], "input_file_description[2]", $input_file_description[ 2 ], 2 );
echo "<br /><strong>" . $words_news[ 'FILE' ] . ":</strong><br /><input type=\"file\" name=\"input_file[3]\" /><br />";
$html -> upperform( $words_news[ 'TITLE' ], "input_file_title[3]", $input_file_title[ 3 ], 1 );
$html -> upperform( $words_news[ 'DESCRIPTION' ], "input_file_description[3]", $input_file_description[ 3 ], 2 );
echo "<br /><strong>" . $words_news[ 'FILE' ] . ":</strong><br /><input type=\"file\" name=\"input_file[4]\" /><br />";
$html -> upperform( $words_news[ 'TITLE' ], "input_file_title[4]", $input_file_title[ 4 ], 1 );
$html -> upperform( $words_news[ 'DESCRIPTION' ], "input_file_description[4]", $input_file_description[ 4 ], 2 );
echo "</div>";
echo "<input type=\"submit\" name=\"input_doupload\" value=\"" . $words_news[ 'UPLOAD' ] . "\" />";
1 Re: Remove "File Attachments" from news
avatar
OP 232
From: -
Now how to completely remove File Attachments field from add news story?
1 Re: Remove "File Attachments" from news
avatar
OP 232
From: -
Thanks. I will wait with this mod.
1 Re: Remove "File Attachments" from news
avatar
Editor
0
From: -
This would require a few modification in the news module PHP files.

For example, /cadmin/news/addnewsstory.php:

You need to remove:

      echo "<strong>" . $words_news[ 'FILE' ] . ":</strong><br /><input type=\"file\" name=\"input_file[0]\" /><br />";

$html -> upperform( $words_news[ 'TITLE' ], "input_file_title[0]", $input_file_title[ 0 ], 1 );
$html -> upperform( $words_news[ 'DESCRIPTION' ], "input_file_description[0]", $input_file_description[ 0 ], 2 );
echo "<div id=\"attachment_form_close\"><br /><a href=\"#\" onclick=\"show_form2(); return false;\">" . $words_news[ 'ATTACH_MULTIPLE_FILES' ] . "</a><br /><br /></div>";
echo "<div id=\"attachment_form_open\" style=\"display:none\">";
echo "<strong>" . $words_news[ 'FILE' ] . ":</strong><br /><input type=\"file\" name=\"input_file[1]\" /><br />";
$html -> upperform( $words_news[ 'TITLE' ], "input_file_title[1]", $input_file_title[ 1 ], 1 );
$html -> upperform( $words_news[ 'DESCRIPTION' ], "input_file_description[1]", $input_file_description[ 1 ], 2 );
echo "<br /><strong>" . $words_news[ 'FILE' ] . ":</strong><br /><input type=\"file\" name=\"input_file[2]\" /><br />";
$html -> upperform( $words_news[ 'TITLE' ], "input_file_title[2]", $input_file_title[ 2 ], 1 );
$html -> upperform( $words_news[ 'DESCRIPTION' ], "input_file_description[2]", $input_file_description[ 2 ], 2 );
echo "<br /><strong>" . $words_news[ 'FILE' ] . ":</strong><br /><input type=\"file\" name=\"input_file[3]\" /><br />";
$html -> upperform( $words_news[ 'TITLE' ], "input_file_title[3]", $input_file_title[ 3 ], 1 );
$html -> upperform( $words_news[ 'DESCRIPTION' ], "input_file_description[3]", $input_file_description[ 3 ], 2 );
echo "<br /><strong>" . $words_news[ 'FILE' ] . ":</strong><br /><input type=\"file\" name=\"input_file[4]\" /><br />";
$html -> upperform( $words_news[ 'TITLE' ], "input_file_title[4]", $input_file_title[ 4 ], 1 );
$html -> upperform( $words_news[ 'DESCRIPTION' ], "input_file_description[4]", $input_file_description[ 4 ], 2 );
echo "</div>";


However, I would wait 2 days before changing the PHP files after Contentteller 2.0.4 is coming very soon Winking Face

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.