TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 19, 2024, 12:06:49 AM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 70
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 69
  • Total: 69

Quick Upload Block for SmfHacks Gallery Lite

Started by Jpg, March 18, 2007, 06:08:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fotografo74

Quote from: Ken. on February 24, 2009, 01:58:57 PM
Quote from: fotografo74 on February 24, 2009, 01:20:28 PM
Quote from: Ken. on February 24, 2009, 12:44:50 PM
You'll need to wait for a while fotografo74, TinyPortal has not yet been released or updated to work with SMF 2.0 and so there are no blocks for it at this time.
Ok, i'm waiting :-) ( and i'm waiting for TP2! )
I use SMF Gallery  Random Images by Thurnok with SMF2...and works! :-)
forum test:    www.macroforum.org/smf2rc/index.php

I need your block for works with SMF2 :-)
Thanks!
Antonio

Your test forum is running SimplePortal 2.1.1, so you should be asking them for a block code... we only do block codes for TinyPortal. :)
Sure,but i will install TP2 in future...i'm waiting! in www.macroforum.org,official forum,i have TP.
The php block,and code,works to TP and SimplyPortal.
i will try modify myself the query for get id category. Without the query the block shows ok,but is not the category list.
Thanks!
antonio

fotografo74

I solved :-)
Now the code works with SMF2 RC1  ( i'm waiting TP2, now i use Simple Portal)

global $smcFunc, $scripturl, $txt, $context, $settings, $modSettings, $boarddir;
// gallery.index.php is not loaded yet, so load it here
require_once($boarddir.'/Themes/default/languages/Gallery.italian.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%" align="center" height="129">
</tr>

<tr class="windowbg2">
<td class="smalltext"><b>Titolo:</b><br /><input type="text" name="title" size="15" /></td>
</tr>
<tr class="windowbg2">
<td class="smalltext" align="left"><b>Categoria</b> </td>
</tr>
<tr class="windowbg2">
<td class="smalltext"><select name="cat">';


// get our query results to create select box
$dbresult = $smcFunc['db_query'] ('', "
SELECT
id_cat, title, orderby
FROM {db_prefix}gallery_cat
ORDER BY roworder DESC");
while($row = $smcFunc ['db_fetch_assoc'] ($dbresult)) 


if (($row['id_cat'] != 1) && ($row['id_cat'] != 15) && ($row['id_cat'] != 16)) 
{    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>Descrizione:</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>Parole chiave:</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>Permetti commenti</b></td>
</tr>';
}

echo '
<tr class="windowbg2">
<td class="smalltext" width="28%" colspan="2" height="26" align="left" class="windowbg2"><input type="submit" value="Carica foto" name="submit" /></td>
</tr>

</table><br />
';



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


I se that category number 1-15-16 in my Smf Gaeery Pro not display.
Antonio