Jump to content

Recommended Posts

??? Im Stuck! I been stuck for  a long time  :'(

 

Okay im trying to add keywords/categories.

 

Right Now i got a Multi upload image hoster. When you upload images it gose to a page that displays links. On that page i am trying to put a box with Keyword input box and a List box with the categories. When a user uploads more than one image code below is just repeted.

 

I finished the part to search the database but i cant add the keywords to the database i keep failing.

 

The Database is called

 

mmh_file_storage

      -file_id 

-filename

-gallery_id

-album_id

-file_title

    -keyword

    -categories

 

<if="is_file($mmhclass->info->root_path.$mmhclass->info->config['upload_path'].$mmhclass->funcs->thumbnail_name("<# FILENAME #>")) == false && preg_match("/links|viewer/", $mmhclass->input->server_vars['php_self']) == false && $mmhclass->templ->templ_globals['extension'] != "bmp" && $mmhclass->templ->templ_globals['extension'] != "ico"">
<div style="text-align: center;">
<b>Notice</b>: Failed to generate thumbnail for file <b><# FILENAME #></b> because of an internal error.
<br /><br />
</div>
</endif>
<if="preg_match("/viewer/", $mmhclass->input->server_vars['php_self']) == false">
<div style="text-align: center;">
<a href="viewer.php?file=<# FILENAME #>" class="button1">View Full Image</a>
</div>
<br />
</endif>
<table cellpadding="5" cellspacing="0" width="100%">
<tr>

<td style="width: 80%;">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="<# BASE_URL #><# UPLOAD_PATH #><# FILENAME #>" /></td>
<td>Direct Link</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="<a href="<# BASE_URL #>viewer.php?file=<# FILENAME #>"><img src="<# THUMBNAIL #>" border="0" alt="<# FILENAME #>" /></a>" /></td>
<td>Thumbnail for Websites</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="[url=<# BASE_URL #>viewer.php?file=<# FILENAME #>][img=<# THUMBNAIL #>][/url]" /></td>
<td>Thumbnail for forums</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="Thanks to <# SITE_NAME #> for <a href="<# BASE_URL #>">Free image hosting</a>" /></td>
<td>Link to us</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="[url=<# BASE_URL #>][img=<# BASE_URL #><# UPLOAD_PATH #><# FILENAME #>][/url]" /></td>
<td>Hotlink for forums</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="<a href="<# BASE_URL #>"><img src="<# BASE_URL #><# UPLOAD_PATH #><# FILENAME #>" border="0" alt="<# SITE_NAME #>" /></a>" /></td>
<td>Hotlink for Websites</td>
</tr>
</table>
</td>
</tr>
</table>

Link to comment
https://forums.phpfreaks.com/topic/96250-php-help/
Share on other sites

??? Im Stuck! I been stuck for  a long time  :'(

 

Okay im trying to add keywords/categories.

 

Right Now i got a Multi upload image hoster. When you upload images it gose to a page that displays links. On that page i am trying to put a box with Keyword input box and a List box with the categories. When a user uploads more than one image code below is just repeted.

 

I finished the part to search the database but i cant add the keywords to the database i keep failing.

 

The Database is called

 

mmh_file_storage

      -file_id 

-filename

-gallery_id

-album_id

-file_title

    -keyword

    -categories

 

<if="is_file($mmhclass->info->root_path.$mmhclass->info->config['upload_path'].$mmhclass->funcs->thumbnail_name("<# FILENAME #>")) == false && preg_match("/links|viewer/", $mmhclass->input->server_vars['php_self']) == false && $mmhclass->templ->templ_globals['extension'] != "bmp" && $mmhclass->templ->templ_globals['extension'] != "ico"">
<div style="text-align: center;">
<b>Notice</b>: Failed to generate thumbnail for file <b><# FILENAME #></b> because of an internal error.
<br /><br />
</div>
</endif>
<if="preg_match("/viewer/", $mmhclass->input->server_vars['php_self']) == false">
<div style="text-align: center;">
<a href="viewer.php?file=<# FILENAME #>" class="button1">View Full Image</a>
</div>
<br />
</endif>
<table cellpadding="5" cellspacing="0" width="100%">
<tr>

<td style="width: 80%;">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="<# BASE_URL #><# UPLOAD_PATH #><# FILENAME #>" /></td>
<td>Direct Link</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="<a href="<# BASE_URL #>viewer.php?file=<# FILENAME #>"><img src="<# THUMBNAIL #>" border="0" alt="<# FILENAME #>" /></a>" /></td>
<td>Thumbnail for Websites</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="[url=<# BASE_URL #>viewer.php?file=<# FILENAME #>][img=<# THUMBNAIL #>][/url]" /></td>
<td>Thumbnail for forums</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="Thanks to <# SITE_NAME #> for <a href="<# BASE_URL #>">Free image hosting</a>" /></td>
<td>Link to us</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="[url=<# BASE_URL #>][img=<# BASE_URL #><# UPLOAD_PATH #><# FILENAME #>][/url]" /></td>
<td>Hotlink for forums</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="<a href="<# BASE_URL #>"><img src="<# BASE_URL #><# UPLOAD_PATH #><# FILENAME #>" border="0" alt="<# SITE_NAME #>" /></a>" /></td>
<td>Hotlink for Websites</td>
</tr>
</table>
</td>
</tr>
</table>

 

Why on Earth have you used all your php in < > tags? <if=.. </endif>.. i've never seen that syntax before... that could just be me but still..

 

To add the keywords in php use

 

 <?php
$sql = "INSERT INTO (`file_id`,`filename`,`gallery_id`,`album_id`,`file_title`,`keyword`,`categories`) VALUES (NULL,'$filename','$gallery_id','$album_id','$file_title','$keyword','$category')"; //NULL assuming the id is auto_increment 

$result = mysql_query($sql) or die("Error in sql: ".mysql_error());
?>

 

Sam

Link to comment
https://forums.phpfreaks.com/topic/96250-php-help/#findComment-492801
Share on other sites

Hey Sorry About that lordfrikk is correct that is a template tag.

 

Thanks For the Reply Helraizer But i know how to put keywords into the database.

 

But The Values For     

 

    -file_id

  -filename   

  -gallery_id   

  -album_id   

  -file_title

 

Are Inserted when you upload the file, But now what i want to do is upload keywords and Categories if you under stand.

 

Something Like This.

 

 <?php
$sql = "INSERT INTO (`keyword`,`categories`) VALUES ('$keyword','$category')"; //NULL assuming the id is auto_increment 

$result = mysql_query($sql) or die("Error in sql: ".mysql_error());
?>

 

 

 

But This I Dont Understand How to do this.

 

This Code Here Is repeated.  So if you upload more than 1 image it just repeats itself. I want to add a List box that has predefined categories and a Input Field for the keywords. But just one submit button if you understand.

 

I dont know how to submit all the fields and how to get it to submit to switch image.

 

 

 <if="is_file($mmhclass->info->root_path.$mmhclass->info->config['upload_path'].$mmhclass->funcs->thumbnail_name("<# FILENAME #>")) == false && preg_match("/links|viewer/", $mmhclass->input->server_vars['php_self']) == false && $mmhclass->templ->templ_globals['extension'] != "bmp" && $mmhclass->templ->templ_globals['extension'] != "ico"">
<div style="text-align: center;">
<b>Notice</b>: Failed to generate thumbnail for file <b><# FILENAME #></b> because of an internal error.
<br /><br />
</div>
</endif>
<if="preg_match("/viewer/", $mmhclass->input->server_vars['php_self']) == false">
<div style="text-align: center;">
<a href="viewer.php?file=<# FILENAME #>" class="button1">View Full Image</a>
</div>
<br />
</endif>
<table cellpadding="5" cellspacing="0" width="100%">
<tr>

<td style="width: 80%;">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="<# BASE_URL #><# UPLOAD_PATH #><# FILENAME #>" /></td>
<td>Direct Link</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="<a href="<# BASE_URL #>viewer.php?file=<# FILENAME #>"><img src="<# THUMBNAIL #>" border="0" alt="<# FILENAME #>" /></a>" /></td>
<td>Thumbnail for Websites</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="[url=<# BASE_URL #>viewer.php?file=<# FILENAME #>][img=<# THUMBNAIL #>][/url]" /></td>
<td>Thumbnail for forums</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="Thanks to <# SITE_NAME #> for <a href="<# BASE_URL #>">Free image hosting</a>" /></td>
<td>Link to us</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="[url=<# BASE_URL #>][img=<# BASE_URL #><# UPLOAD_PATH #><# FILENAME #>][/url]" /></td>
<td>Hotlink for forums</td>
</tr>
<tr>
<td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 310px" name="option" value="<a href="<# BASE_URL #>"><img src="<# BASE_URL #><# UPLOAD_PATH #><# FILENAME #>" border="0" alt="<# SITE_NAME #>" /></a>" /></td>
<td>Hotlink for Websites</td>
</tr>
</table>
</td>
</tr>
</table> 

Link to comment
https://forums.phpfreaks.com/topic/96250-php-help/#findComment-492911
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.