Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 177
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 183
Total: 183

Author Topic: Quick upload to SMF gallery (TP Block)  (Read 15499 times)

0 Members and 1 Guest are viewing this topic.

Offline edwardsiow

  • Member
  • *
  • Posts: 10
    • View Profile
Quick upload to SMF gallery (TP Block)
« on: March 14, 2007, 02:26:07 am »
i would like to request left/right side TP block code which i can use it to upload a picture to smf gallery without going into gallery itself...

Attached image is a sample snapshots (i draw myself)

title and file must be inserted before upload can be done..

thanks for kind programmers who willing to help me....

your help is much appreciate...thanks

Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: Quick upload to SMF gallery (TP Block)
« Reply #1 on: March 16, 2007, 02:48:20 pm »
Did it just for you...cause I recently learned how the forms work...but thank you I have a new code to lay back on my foundation when editing the profile.
Code: [Select]
global $scripturl, $modSettings, $db_prefix, $txt, $context, $settings, $boarddir;
// gallery.index.php is not loaded yet, so load it here
require_once($boarddir.'/Themes/default/languages/Gallery.english.php');

// text area tag var
$ta_tag = "TEXTAREA";

//Get the category
@$cat = (int) $_REQUEST['cat'];

// display the block info
echo '
<div class="tborder">
<form method="POST" enctype="multipart/form-data" name="picform" id="picform" action="' . $scripturl . '?action=gallery&sa=add2">
<table border="0" cellpadding="0" cellspacing="0" width="95%" height="129">
<tr class="catbg">
<td class="smalltext" width="50%" colspan="1" height="19" align="left"><b>Quick Upload</b></td>
</tr>
<tr class="windowbg2">
<td class="smalltext"><b>Title:</b><br /><input type="text" name="title" size="15" /></td>
</tr>
<tr class="windowbg2">
<td class="smalltext" align="left"><b>Category</b> </td>
</tr>
<tr class="windowbg2">
<td class="smalltext"><select name="cat">';


// get our query results to create select box
$dbresult = db_query("SELECT ID_CAT, title FROM {$db_prefix}gallery_cat ORDER BY roworder ASC", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($dbresult)){
echo '
<option value="' . $row['ID_CAT']  . '" ' . (($cat == $row['ID_CAT']) ? ' selected="selected"' : '') .'>' . $row['title'] . '</option>';
}


echo '
</select>
</td>
</tr>
<tr class="windowbg2">
<td class="smalltext" align="left"><b>Description:</b> </td>
</tr>
<tr class="windowbg2">
<td class="smalltext"><'.$ta_tag.' name="description" rows="6" cols="16"></'.$ta_tag.'></td>
</tr>
<tr class="windowbg2">
<td class="smalltext" align="left"><b>Keywords:</b> </td>
</tr>
<tr class="windowbg2">
<td class="smalltext"><input type="text" name="keywords" maxlength="100" size="15" /></td>
</tr>
<tr class="windowbg2">
<td class="smalltext" align="left"><b>' . $txt['gallery_form_uploadpic'] . '</b> </td>
</tr>
<tr class="windowbg2">
<td class="smalltext"><input type="file" size="12" name="picture" /></td>
</tr>';

if(!empty($modSettings['gallery_commentchoice'])){
echo '
<tr class="windowbg2">
<td class="smalltext" align="left"><b>' . $txt['gallery_form_additionaloptions'] . '</b> </td>
</tr>
<tr class="windowbg2">
<td class="smalltext"><input type="checkbox" name="allowcomments" checked="checked" /><b>Allow Comments</b></td>
</tr>';
}

echo '
<tr class="windowbg2">
<td class="smalltext" width="28%" colspan="2" height="26" align="left" class="windowbg2"><input type="submit" value="Add Picture" name="submit" /></td>
</tr>
</table><br />
';

if(!allowedTo('smfgallery_autoapprove'))
echo $txt['gallery_form_notapproved'];

echo '
</form>
</div>';
« Last Edit: March 24, 2007, 12:32:05 pm by Jpg »





Offline edwardsiow

  • Member
  • *
  • Posts: 10
    • View Profile
Re: Quick upload to SMF gallery (TP Block)
« Reply #2 on: March 18, 2007, 09:32:43 am »
thank you for your kindness....

i will try it out now and report back to you later....

thanks a lot!

Offline edwardsiow

  • Member
  • *
  • Posts: 10
    • View Profile
Re: Quick upload to SMF gallery (TP Block)
« Reply #3 on: March 18, 2007, 09:36:37 am »
it's work absolutely fine and great!!!

nice to meet you...

 :D

Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: Quick upload to SMF gallery (TP Block)
« Reply #4 on: March 18, 2007, 11:44:48 am »
Glad you like it. :P
If you have any problems just tell me...

And nice to meet you too. :)





Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: Quick upload to SMF gallery (TP Block)
« Reply #5 on: March 20, 2007, 11:10:17 pm »
Updated the code.





Offline RWL

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • RWL
Re: Quick upload to SMF gallery (TP Block)
« Reply #6 on: March 23, 2007, 07:36:40 am »
Hi Jpg,

Great code but it wont fit into a side block for me - see attached.

Regards,

Wilsy.
RewindLancs.com Management


Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: Quick upload to SMF gallery (TP Block)
« Reply #7 on: March 24, 2007, 12:31:44 pm »
Code: [Select]
global $scripturl, $modSettings, $db_prefix, $txt, $context, $settings, $boarddir;
// gallery.index.php is not loaded yet, so load it here
require_once($boarddir.'/Themes/default/languages/Gallery.english.php');

// text area tag var
$ta_tag = "TEXTAREA";

//Get the category
@$cat = (int) $_REQUEST['cat'];

// display the block info
echo '
<div class="tborder">
<form method="POST" enctype="multipart/form-data" name="picform" id="picform" action="' . $scripturl . '?action=gallery&sa=add2">
<table border="0" cellpadding="0" cellspacing="0" width="95%" height="129">
<tr class="catbg">
<td class="smalltext" width="50%" colspan="1" height="19" align="left"><b>Quick Upload</b></td>
</tr>
<tr class="windowbg2">
<td class="smalltext"><b>Title:</b><br /><input type="text" name="title" size="15" /></td>
</tr>
<tr class="windowbg2">
<td class="smalltext" align="left"><b>Category</b> </td>
</tr>
<tr class="windowbg2">
<td class="smalltext"><select name="cat">';


// get our query results to create select box
$dbresult = db_query("SELECT ID_CAT, title FROM {$db_prefix}gallery_cat ORDER BY roworder ASC", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($dbresult)){
echo '
<option value="' . $row['ID_CAT']  . '" ' . (($cat == $row['ID_CAT']) ? ' selected="selected"' : '') .'>' . $row['title'] . '</option>';
}


echo '
</select>
</td>
</tr>
<tr class="windowbg2">
<td class="smalltext" align="left"><b>Description:</b> </td>
</tr>
<tr class="windowbg2">
<td class="smalltext"><'.$ta_tag.' name="description" rows="6" cols="16"></'.$ta_tag.'></td>
</tr>
<tr class="windowbg2">
<td class="smalltext" align="left"><b>Keywords:</b> </td>
</tr>
<tr class="windowbg2">
<td class="smalltext"><input type="text" name="keywords" maxlength="100" size="15" /></td>
</tr>
<tr class="windowbg2">
<td class="smalltext" align="left"><b>' . $txt['gallery_form_uploadpic'] . '</b> </td>
</tr>
<tr class="windowbg2">
<td class="smalltext"><input type="file" size="12" name="picture" /></td>
</tr>';

if(!empty($modSettings['gallery_commentchoice'])){
echo '
<tr class="windowbg2">
<td class="smalltext" align="left"><b>' . $txt['gallery_form_additionaloptions'] . '</b> </td>
</tr>
<tr class="windowbg2">
<td class="smalltext"><input type="checkbox" name="allowcomments" checked="checked" /><b>Allow Comments</b></td>
</tr>';
}

echo '
<tr class="windowbg2">
<td class="smalltext" width="28%" colspan="2" height="26" align="left" class="windowbg2"><input type="submit" value="Add Picture" name="submit" /></td>
</tr>
</table><br />
';

if(!allowedTo('smfgallery_autoapprove'))
echo $txt['gallery_form_notapproved'];

echo '
</form>
</div>';

Try that...My bad for not putting it up sooner...





Offline Lum-chan

  • Member
  • *
  • Posts: 8
  • Lum-chan is cute!
    • View Profile
    • The World of Urusei Yatsura's Lum
Re: Quick upload to SMF gallery (TP Block)
« Reply #8 on: July 15, 2008, 10:01:29 am »
I use this modified code to get it in good use with TinyPortal 1.0.5 Beta1. I changed the layout a bit because I didn't like the effect of class="windowbg2", so I removed these and removed the line which says 'Quick Upload'.
This way it fits better in the Deafult Theme and variantions of it.

Code: [Select]
global $scripturl, $modSettings, $db_prefix, $txt, $context, $settings, $boarddir;
// gallery.index.php is not loaded yet, so load it here
require_once($boarddir.'/Themes/default/languages/Gallery.english.php');

// text area tag var
$ta_tag = "TEXTAREA";

//Get the category
@$cat = (int) $_REQUEST['cat'];

// display the block info
echo '
<div>
<form method="POST" enctype="multipart/form-data" name="picform" id="picform" action="' . $scripturl . '?action=gallery&sa=add2">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="129">
<tr>
<td class="smalltext">Title:<br /><input type="text" name="title" size="15" /></td>
</tr>
<tr>
<td class="smalltext">Category</td>
</tr>
<tr>
<td class="smalltext"><select name="cat">';


// get our query results to create select box
$dbresult = db_query("SELECT ID_CAT, title FROM {$db_prefix}gallery_cat ORDER BY roworder ASC", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($dbresult)){
echo '
<option value="' . $row['ID_CAT']  . '" ' . (($cat == $row['ID_CAT']) ? ' selected="selected"' : '') .'>' . $row['title'] . '</option>';
}


echo '
</select>
</td>
</tr>
<tr>
<td class="smalltext">Description: </td>
</tr>
<tr>
<td class="smalltext"><'.$ta_tag.' name="description" rows="6" cols="16"></'.$ta_tag.'></td>
</tr>
<tr>
<td class="smalltext">Keywords: </td>
</tr>
<tr>
<td class="smalltext"><input type="text" name="keywords" maxlength="100" size="15" /></td>
</tr>
<tr>
<td class="smalltext">' . $txt['gallery_form_uploadpic'] . ' </td>
</tr>
<tr>
<td class="smalltext"><input type="file" size="12" name="picture" /></td>
</tr>';

if(!empty($modSettings['gallery_commentchoice'])){
echo '
<tr>
<td class="smalltext" align="left">' . $txt['gallery_form_additionaloptions'] . ' </td>
</tr>
<tr>
<td class="smalltext"><input type="checkbox" name="allowcomments" checked="checked" />Allow Comments</td>
</tr>';
}

echo '
<tr>
<td class="smalltext" width="28%" colspan="2" height="26"><input type="submit" value="Add Picture" name="submit" /></td>
</tr>
</table>
';

if(!allowedTo('smfgallery_autoapprove'))
echo $txt['gallery_form_notapproved'];

echo '
</form>
</div>';

Example here at at my website

I hope this small modification of your code-snipped is useful for others.
Lum-chan


Offline Qayyom

  • Member
  • *
  • Posts: 7
    • View Profile
Re: Quick upload to SMF gallery (TP Block)
« Reply #9 on: September 24, 2008, 04:20:05 am »
I use this modified code to get it in good use with TinyPortal 1.0.5 Beta1. I changed the layout a bit because I didn't like the effect of class="windowbg2", so I removed these and removed the line which says 'Quick Upload'.
This way it fits better in the Deafult Theme and variantions of it.

I hope this small modification of your code-snipped is useful for others.

Dear Lum-chan,

I am using your modified codes; it is better then before and fits well in the block,

A little bit modification required from you

Please resize category drop-down menu width to get fit in the block

See image.

waiting your early and positive response

Offline fotografo74

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Quick upload to SMF gallery (TP Block)
« Reply #10 on: September 24, 2008, 08:35:41 am »
Thank you JPG!
This Mod is perfect for my photography's forum ( macroforum.org )
I added align=center to <table>

request:
It's possibile add the thumbnail image in  ( like Thumbnail topic mod...http://www.smfhacks.com/index.php/topic,2238.msg10980.html#msg10980) ?
Thanks and sorry for my english
Antonio

Offline Ken.

  • SMF Gallery Pro Customer
  • Full Member
  • *****
  • Posts: 113
  • TP Rules!
    • View Profile
Re: Quick upload to SMF gallery (TP Block)
« Reply #11 on: December 02, 2008, 04:33:54 pm »
I use this modified code to get it in good use with TinyPortal 1.0.5 Beta1. I changed the layout a bit because I didn't like the effect of class="windowbg2", so I removed these and removed the line which says 'Quick Upload'.
This way it fits better in the Deafult Theme and variantions of it.

I hope this small modification of your code-snipped is useful for others.

Dear Lum-chan,

I am using your modified codes; it is better then before and fits well in the block,

A little bit modification required from you

Please resize category drop-down menu width to get fit in the block

See image.

waiting your early and positive response

On mine I found that long album names caused the breakout on that dropdown menu.
It would be great if the code could accommodate those longer names in some way, but for now my solution was to edit the album names to make them shorter.

 

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
7006 Views
Last post May 13, 2008, 10:37:29 am
by Apex
0 Replies
3712 Views
Last post September 04, 2008, 10:27:18 pm
by Baked_Bruce
2 Replies
5138 Views
Last post December 05, 2008, 11:33:51 pm
by Beltazar
2 Replies
9266 Views
Last post October 15, 2010, 04:03:02 pm
by Rafferty
6 Replies
6208 Views
Last post October 18, 2014, 12:55:28 pm
by shuban

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal