SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
May 25, 2012, 12:26:24 pm

Login with username, password and session length
Members
Total Members: 10073
Latest: makablue
Stats
Total Posts: 28694
Total Topics: 4979
Online Today: 88
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 53
Total: 53
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
0 Members and 2 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Quick upload to SMF gallery (TP Block)  (Read 9614 times)
edwardsiow
Newbie
*
Offline Offline

Posts: 10


View Profile
« 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


* example.jpg (8.46 KB, 172x299 - viewed 708 times.)
Logged
Jpg
Newbie
*
Offline Offline

Posts: 25


I love cats they taste like chicken!!


View Profile WWW
« 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:
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>';


* box.jpg (12.2 KB, 170x330 - viewed 711 times.)
« Last Edit: March 24, 2007, 12:32:05 pm by Jpg » Logged





edwardsiow
Newbie
*
Offline Offline

Posts: 10


View Profile
« 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!
Logged
edwardsiow
Newbie
*
Offline Offline

Posts: 10


View Profile
« Reply #3 on: March 18, 2007, 09:36:37 am »

it's work absolutely fine and great!!!

nice to meet you...

 Cheesy
Logged
Jpg
Newbie
*
Offline Offline

Posts: 25


I love cats they taste like chicken!!


View Profile WWW
« Reply #4 on: March 18, 2007, 11:44:48 am »

Glad you like it. Tongue
If you have any problems just tell me...

And nice to meet you too. Smiley
Logged





Jpg
Newbie
*
Offline Offline

Posts: 25


I love cats they taste like chicken!!


View Profile WWW
« Reply #5 on: March 20, 2007, 11:10:17 pm »

Updated the code.
Logged





RWL
Full Member
***
Offline Offline

Posts: 100



View Profile WWW
« 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.


* s_shot.png (39.26 KB, 470x574 - viewed 717 times.)
Logged

RewindLancs.com Management

Jpg
Newbie
*
Offline Offline

Posts: 25


I love cats they taste like chicken!!


View Profile WWW
« Reply #7 on: March 24, 2007, 12:31:44 pm »

Code:
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...
Logged





Lum-chan
Newbie
*
Offline Offline

Posts: 8


Lum-chan is cute!


View Profile WWW
« 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:
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.
Logged

Lum-chan

Qayyom
Newbie
*
Offline Offline

Posts: 7


View Profile
« 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


* UPLOAD.gif (6.49 KB, 202x313 - viewed 528 times.)
Logged
fotografo74
SMF Gallery Pro Customer
Jr. Member
*****
Offline Offline

Posts: 55


View Profile
« 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
Logged
Ken.
Jr. Member
**
Offline Offline

Posts: 74

TP Rules!


View Profile
« 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.

 
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[Today at 10:52:25 am]

[Today at 10:35:29 am]

[May 24, 2012, 08:02:50 am]

[May 24, 2012, 04:11:41 am]

[May 21, 2012, 08:54:11 am]

[May 20, 2012, 11:06:52 am]

[May 20, 2012, 05:58:11 am]

[May 19, 2012, 06:16:58 pm]

[May 19, 2012, 05:42:37 pm]

[May 18, 2012, 03:08:38 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.16 | SMF © 2006-2011, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 0.291 seconds with 19 queries.