
Originally Posted by
Doodlebuckets
Clyde, I have modified this mod to be used to upload recipes. No images are necessary for the recipes, so can you tell me how to turn off the message stack error "Warning: no file uploaded"? See here
http://www.ncwheatmontanacoop.com/or...e=links_submit
I got rid of the default banner message but can't figure out how to get rid of the other one.
Also, is there a way for the recipes to keep their formatting without me having to go into the admin and format it with HTML? It's all coming out one big blob of text with no line breaks. Our recipe submitters don't all know HTML.
Thanks!
Amy,
I'm not sure which files you've modified (and/or whether you changed the names of the files) but I can give you a general outline of what you need to do based on the original Link Manager file names and locations.
first you'll need to modify includes/modules/pages/links_submit/header_php.php
at about line 14 delete/comment out the following line of code:
Code:
require(DIR_WS_CLASSES . 'upload.php');
Next delete the folllowing section of code beginning at around line 81 - 98
Code:
// BOF Upload an image when form field is filled in by user
if ($links_image = new upload('links_image_url')) {
$links_image->set_destination(DIR_WS_IMAGES . LINK_IMAGE_DIRECTORY);
if ($links_image->parse() && $links_image->save()) {
$links_image_name = LINK_IMAGE_DIRECTORY . $links_image->filename;
}
if ($links_image->filename != '') {
$db->Execute("update " . TABLE_LINKS . "
set links_image_url = '" . $links_image_name . "'
where links_id = '" . (int)$links_id . "'");
}else { // Use default image if form field is left blank
$links_image_name = LINK_IMAGE_DIRECTORY . DEFAULT_LINK_IMAGE;
$db->Execute("update " . TABLE_LINKS . "
set links_image_url = '" . $links_image_name . "'
where links_id = '" . (int)$links_id . "'");
$messageStack->add_session('header', WARNING_DEFAULT_FILE_UPLOADED, 'success');
}
}
save the file and upload to your server.
Next open includes/modules/YOUR_TEMPLATE/link_listing.php
Find the following section of code at around line 73 - 76
Code:
if (DISPLAY_LINK_DESCRIPTION_AS_LINK == 'true') {
$lc_text = '<a href="' . zen_get_links_url($listing_query->fields['links_id']) . '" target="_blank">' . $listing_query->fields['links_title'] . '</a><br /><a href="' . zen_get_links_url($listing_query->fields['links_id']) . '" target="_blank">' . $listing_query->fields['links_description'] . '</a>';
} else {
$lc_text = '<a href="' . zen_get_links_url($listing_query->fields['links_id']) . '" target="_blank">' . $listing_query->fields['links_title'] . '</a><br />' . $listing_query->fields['links_description']; }
replace this section with the following code:
Code:
if (DISPLAY_LINK_DESCRIPTION_AS_LINK == 'true') {
$lc_text = '<a href="' . zen_get_links_url($listing_query->fields['links_id']) . '" target="_blank">' . $listing_query->fields['links_title'] . '</a><br /><a href="' . zen_get_links_url($listing_query->fields['links_id']) . '" target="_blank">' . nl2br($listing_query->fields['links_description']) . '</a>';
} else {
$lc_text = '<a href="' . zen_get_links_url($listing_query->fields['links_id']) . '" target="_blank">' . $listing_query->fields['links_title'] . '</a><br />' . nl2br($listing_query->fields['links_description']); }
Save the file and upload to your server.
Let me know if you need additional assistance.