this is hacking work to add full features custom mod with good integration in TinyPortal.
goal: make empty stub or template for right way to inject custom module in TP.
for good coding style, mod must have standard and short name:
TP Dummy Mod and
dummytemplate will be install as standard SMF module, but through validating version SMF and TinyPortal as minimum. have standard stub for readme, make own directory tp-dummy and one table in db {tp_prefix}dummy
template will be present as standard item in TinyPortal administration menu
Dummy (at left) with three tabs
Setting,
Permissions,
Suggestion, etc item in TinyPortal Modules tab
currently, template design make for SMF 1.1.4 and TP 0.9.3
DummyMod initial version is 0.9 ;)
Package Name:
TP Dummy ModPackage Version:
0.9 betaInstallation Instructions for SMF version: 1.1.4Readme file:
readme.txtPHP script to execute:
install.phpModification file:
modification.xmlFiles Installed- TPdummy.php will be copied to $sourcedir
- TPdummyAdmin.template.php will be copied to $themedir
- TPdummyManager.template.php will be copied to $themedir
- TPdummyAdmin.english.php will be copied to $themedir/languages
- TPdummy.png will be copied to $imagesdir
- package-info.xml will be copied to $boarddir/tp-dummy
Directories Installed- tp-dummy will be copied to $boarddir
Uninstallation Instructions- PHP script to execute: uninstall.php
- Modification file: modification.xml
Directories deleted- $boarddir/tp-dummy will be deleted
Files deleted- $sourcedir/TPdummy.php will be deleted
- $themedir/TPdummyAdmin.template.php will be deleted
- $themedir/TPdummyManager.template.php will be deleted
- $themedir/languages/TPdummyAdmin.english.php will be deleted
- $imagesdir/TPdummy.png will be deleted
Note: it is my eight msg ;D
very nice Grand Duke!! :D im sure you will have a few (if not a lot) of people that will play with this.. thanks!! ;)
1.......In TP 1, None of SMF/TP file modifying will be required if you use its module manager
2.......It is not necessary to HAVE a uninstall.php file
3.......Neither it is to modify Profile.php
4.......You forgot /Themes/default/languages/TPdummy.english.php
5.......It is not necessary to have a Image file.
6.......Whats the purpose of tp-dummy folder?
1.......well, todo in ver.1.0 too
2.......uninstall.php for clear all steps of Dummy :) but may be uninstall move to install
3.......Profile.php - TP have own settings for user
4.......TPdummy.english.php and russian :) + utf8
5.......Image file for right place to other featured modules. will be using in copyright tab for example
6.......tp-dummy folder for right place and right permission
comments welcome! and code or attach
2........Uninstall.php is not always necessary, since sometimes people uninstall for upgrading or just cleaning.
3........It depends on what kind of Module you are making, not that it will be always required
4........What!! What about other languages :p
5........Well, It depends as you said, same with 6.
3.......need explore all TP with 3d: portal, module, user measures O0
readme.txt showing before installation
TP DummyMod v0.9beta for SMF 1.1.4 and TinyPortal v0.983
..............................................................................
This is empty stub, right example, mod template for integration in TinyPortal.
Once installed, visit the admin panel under TinyPortal.
There you will find a link for Dummy and own item in Modules tab.
Visit for more information to
http://www.tinyportal.net/index.php?topic=22008.0
..............................................................................
TP Rocks!!! Yeah!!!
One not from your code.
I dont think it's appropiate for you to use this sites name as author for your code.
I rather see your own name and site as it's you that make this code and not this community.
We stand for our stuff and you for your stuff.
G6, right. but author not want a make private support :) removed
Now that you know the in and out, why not make a good Module out of it?
Quote from: Grand Duke on February 15, 2008, 07:48:26 AM
i'm genius :)
Oh purlease... Galileo never even called himself that :buck2:
Lets see..........;)
after big mind processing :idiot2:, i finished beta version code. O0
i think in new version in smf and tp, many hardcores of module injection will be stripped. :coolsmiley:
and integration custom module will be easy than SMF 1.1.4 + TP 0.93 :-\
here screenshots my biggest hacking work :up::
Tiny Portal/Settings/Modules Enable or Disable TP Dummy
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Flimbo.dreamhackers.ru%2Fimages%2FSMF%2Ftp-dummy%2Ftpmod.jpg&hash=e98b76841f4dcb2b4f69e1a1bb08e953c42312c8)
Tiny Portal/TP Dummy main tab
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Flimbo.dreamhackers.ru%2Fimages%2FSMF%2Ftp-dummy%2Fatab1.jpg&hash=95f0df60f7f4874a3fe8d357c5bd764125e34aff)
Tiny Portal/TP Dummy settings tab
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Flimbo.dreamhackers.ru%2Fimages%2FSMF%2Ftp-dummy%2Fatab2.jpg&hash=626879d244198640cb48bb287772b9b01e003928)
Tiny Portal/TP Dummy advanced tab :)
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Flimbo.dreamhackers.ru%2Fimages%2FSMF%2Ftp-dummy%2Fatab3.jpg&hash=512be99c4669210cebe5da570d58aa1ecd28946b)
TP Dummy Manager view
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Flimbo.dreamhackers.ru%2Fimages%2FSMF%2Ftp-dummy%2Fmanager.jpg&hash=758d717ac00243e92f29c5e45bd269b313566be9)
Profile items of dummys
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Flimbo.dreamhackers.ru%2Fimages%2FSMF%2Ftp-dummy%2Fprof.jpg&hash=dcd228a6a57fb4eface9fae23b4cdad8014a3074)
have a fun :laugh:
well, package is ready O0 and attached to first msg of this topic :up:
hm.. strange synchronicity: this is my eighteen msg ::) where 10 others? :o
TP Dummy Modifictions
Sources/ManagePermissions.php
Find:
'tinyportal_dl' => array(
'tp_dlmanager' => false,
'tp_dlupload' => false,
),
Add after:
'tinyportal_dummy' => array(
'tp_dummy' => false,
),
Sources/Profile.php
Find:
'tplinks' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_links')),
Add after:
'tpdummy' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_dummy')),
Find:
if(($context['user']['is_owner'] || allowedTo('tp_linkmanager')) && $context['TPortal']['show_linkmanager'])
$context['profile_areas']['tinyportal']['areas']['tplinks'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=tplinks">' . $txt['linksprofile'] . '</a>';
Add after:
if(($context['user']['is_owner'] || allowedTo('tp_dummy')) && $context['TPortal']['show_dummy'])
$context['profile_areas']['tinyportal']['areas']['tpdummy'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=tpdummy">' . $txt['dummy-profile'] . '</a>';
Find:
loadtemplate('TPprofile');
$context['page_title'] = $txt['downloadprofile'];
TP_profile_download($memID);
}
Add after:
function tpdummy($memID)
{
global $txt, $user_profile, $db_prefix, $context, $db_prefix;
loadtemplate('TPprofile');
$context['page_title'] = $txt['dummy-profile'];
TP_profile_dummy($memID);
}
Sources/Subs.php
Find:
if (allowedTo('tp_teampage') && $context['TPortal']['show_teampage']){
$context['admin_areas']['tportal']['areas']['tp_teampage'] = '<a href="' . $scripturl . '?action=tpmod;team=admin">' . $txt['tp-admin17'] . '</a>';
}
Add before:
if (allowedTo('tp_dummy') && $context['TPortal']['show_dummy']){
$context['admin_areas']['tportal']['areas']['tp_dummy'] = '<a href="' . $scripturl . '?action=tpmod;dummy=admin">' . $txt['dummy-admin-menu'] . '</a>';
}
Find:
$context['allow_admin'] = allowedTo(array('admin_forum', 'manage_boards', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_attachments', 'manage_smileys','tp_settings','tp_articles','tp_blocks','tp_dlmanager'
Add after:
,'tp_dummy'
Sources/TPhelp.php
Find:
if($context['user']['is_admin'] || allowedTo(array('tp_settings','tp_blocks','tp_articles','tp_dlmanager'
Add after:
,'tp_dummy'
Find:
$context['TPortal']['helptabs']=array('introduction','portal','frontpage','modules','blocks','articles','shoutbox','dlmanager'
Add before:
,'dummy'
Sources/TPmodules.php
Find:
// download manager?
if(isset($_GET['dl'])){
$context['TPortal']['dlsub']=$_GET['dl'];
}
Add after:
// dummy page?
elseif(isset($_GET['dummy'])){
$context['TPortal']['dummysub']=$_GET['dummy'];
}
Find:
// include source files in case of modules
if(isset($context['TPortal']['dlsub'])){
require_once( $sourcedir .'/TPdlmanager.php');
TPdlmanager_init();
}
Add after:
elseif(isset($context['TPortal']['dummysub'])){
require_once( $sourcedir .'/TPdummy.php');
TPdummy_init();
}
Add at end of file:
function tp_profile_dummy($memID)
{
global $txt, $user_profile, $db_prefix, $context, $db_prefix;
$context['page_title'] = $txt['dummy-profile'] ;
}
Sources/TPortal.php
Find:
// and linkmanager?
elseif(isset($_GET['action']) && $_GET['action']=='tpmod' && isset($_GET['link'])){
Add before:
// and dummy page?
elseif(isset($_GET['action']) && $_GET['action']=='tpmod' && isset($_GET['dummy'])){
// fetch the custom theme if any
$request = db_query("SELECT value FROM {$tp_prefix}settings WHERE name='dummy_theme'", __FILE__, __LINE__);
if(mysql_num_rows($request)>0){
$row=mysql_fetch_row($request);
$theme=$row[0];
mysql_free_result($request);
}
}
Sources/TPortalAdmin.php
Find:
// from settings again
elseif($what=='tp_hide_rightbar_forum'){
Add before:
elseif($what=='tp_show_dummy'){
db_query("UPDATE {$tp_prefix}settings SET value='$value' WHERE name='show_dummy'", __FILE__, __LINE__);
$go=7;
}
Find:
),
);
}
if($tpsub=='shoutbox'){
// get latest shouts for admin section
// check that a member has been filtered
Add before:
),
array(
'adminlink' => '<a href="'.$scripturl.'?action=tpmod;dummy=admin">'.$txt['dummy-admin-item'].'</a>',
'modulelink' => '<a href="'.$scripturl.'?action=tpmod;dummy=0">'.$txt['dummy-manager-item'].'</a>',
'state' => $context['TPortal']['show_dummy'],
'fieldname' => 'tp_show_dummy',
Themes/default/TPmodules.template.php
Find:
if($context['TPortal']['show_teampage']=='1')
echo '<li>'.$txt['tp-admin17'].'</li>';
Add after:
if($context['TPortal']['show_dummy']=='1')
echo '<li>'.$txt['dummy-admin-menu'].'</li>';
Themes/default/TPortalAdmin.template.php
Find:
if($context['TPortal']['show_teampage']=='1')
echo '<li>'.$txt['tp-admin17'].'</li>';
Add before:
if($context['TPortal']['show_dummy']=='1')
echo '<li>'.$txt['dummy-admin-menu'].'</li>';
Find:
<option value="team" ' ,$context['TPortal']['blockedit']['access2']['tpmod']=='team' ? 'selected' : '' , '>'.$txt['tp-mod-teampage'].'</option>
Add after:
<option value="dummy" ' ,$context['TPortal']['blockedit']['access2']['tpmod']=='dummy' ? 'selected' : '' , '>'.$txt['dummy-manager-item'].'</option>
Themes/default/TPortalBlocks.template.php
Find:
if($context['TPortal']['show_teampage']=='1')
echo '<li><a class="sitemap_header' , $current=='team' ? '_active' : '' , '" href="'.$scripturl.'?action=tpmod;team"><img src="',$settings['images_url'],'/tpmodule2.gif" border="0" alt="" /> '.$txt['tp-admin17'].'</a></li>';
Add after:
if($context['TPortal']['show_dummy']=='1')
echo '<li><a class="sitemap_header' , $current=='dummy' ? '_active' : '' , '" href="'.$scripturl.'?action=tpmod;dummy"><img src="',$settings['images_url'],'/TPdummy.png" border="0" alt="" /> '.$txt['dummy-map'].'</a></li>';
Find:
if($context['TPortal']['can_submit_article']==1 || allowedTo(array('tp_dlupload','tp_dlmanager','tp_settings','tp_articles','tp_blocks','tp_linkmanager','tp_teampage','tp_gallery'
Add after:
,'tp_dummy'
Find:
/*
if (allowedTo('tp_gallery'))
Add before:
if (allowedTo('tp_dummy'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpmod;dummy=admin">' . $txt['dummy-perm'] . '</a><br />';
Themes/default/TPprofile.template.php
Add at end of file:
function template_tpdummy()
{
global $settings, $txt, $context, $scripturl;
echo '
<div class="bordercolor" style="margin-left: 1ex;">
<table width="100%" cellpadding="4" cellspacing="1" border="0">
<tr class="titlebg">
<td colspan="6">'.$txt['dummy-profile'].'</td>
</tr>
<tr class="windowbg">
<td colspan="6" class="smalltext" style="padding: 2ex;">'.$txt['dummy-profile2'].'</td>
</tr>
<tr class="windowbg2">
<td colspan="6" style="padding: 2ex;">';
echo 'need rewrite your own context for dummys in next code:<br />';
echo '
</td>
</tr>
<tr class="catbg">
<td align="center" width="30%" nowrap="nowrap">Directory</td>
<td align="center" nowrap="nowrap">File</td>
<td align="center" nowrap="nowrap" width="30%">function</td>
</tr>';
echo '
<tr class="windowbg2">
<td valign="top" nowrap="nowrap">Sources</td>
<td valign="top" >TPprofile.php</td>
<td valign="top" ><b>tpdummy</b>($memID);</td>
</tr>';
echo '
<tr class="windowbg2">
<td valign="top" nowrap="nowrap">Themes/default</td>
<td valign="top" >TPprofile.template.php</td>
<td valign="top" ><b>template_tpdummy</b>();</td>
</tr>';
echo '
<tr class="windowbg">
<td colspan="6" style="padding: 2ex; font-weight: bold;"> </td>
</tr>
</table>
</div>';
}
Themes/default/TPwireless.template.php
Add at end of file:
// dummy manager
function template_wap_dummy()
{
echo '[TPwireless.template.php][function <b>template_wap_dummy<b>()]<br /><br />Not implemented yet';
}
Themes/default/languages/TPhelp.english.php
Add at end of file:
// --- TP Dummy begin ---
$txt['dummy-help']= '[dummy-help]';
$txt['dummy-help-main']= '
<h2 style="padding-bottom: 1ex; border-bottom: solid 1px;">[tphelp_dummy_main]</h2>
The dummy manager is currently the only module implemented in TinyPortal. Using the dummy manager, you will be very happy!
<div class="windowbg3" style="margin-top: 1em; padding: 2ex;">If you want to explore more the features of TP, both as a member and as moderator, be sure
to visit our <a href="http://www.tinyportal.net/smf/index.php?board=85.0" target="_blank"><b>Documentation boards</b></a> on tinyportal.co.uk.
</div>';
// --- TP Dummy end ---
Themes/default/languages/TPortal.english.php
Add at end of file:
// --- TP Dummy begin ---
$txt['dummy-admin-menu'] = '[dummy-admin-menu]'; // Dummy Manager
$txt['dummy-manager-off'] = '[dummy-manager-off] :: The Dummy Manager module is not active.';
$txt['dummy-map'] = '[dummy-map]'; // Dummys
$txt['dummy-linktree'] = '[dummy-linktree]'; // Dummys
$txt['dummy-profile'] = '[dummy-profile]'; // View Dummys
$txt['dummy-profile2'] = '[dummy-profile2] :: All dummys made by the member.';
$txt['dummy-perm'] = '[dummy-perm]'; // Manage Dummy
$txt['dummy-perm-help'] = '[dummy-perm-help] :: Allows you to manage dummy and operate any part of the Dummy manager admin screens.';
$txt['dummy-cannot'] = '[dummy-cannot] :: Sorry, you aren\'t allowed to manage dummy.';
// --- TP Dummy end ---
Themes/default/languages/TPortalAdmin.english.php
Add at end of file:
// --- TP Dummy begin ---
$txt['dummy-manager-item'] = '[dummy-manager-item]'; // Dummy Manager
$txt['dummy-admin-item'] = '[dummy-admin-item]'; // Dummy Admin
// --- TP Dummy end ---
Block, what do you think about making TP Dummy for 1.0.x version too ::)
for example, i will can try to add new module by integrating embedded Gallery2 (http://gallery.menalto.com/) O0
at now, main problems for me - can't view new TP sources TP telepathically :2funny:
You'll have to wait like the rest.. it isn't finished yet.
There already is a SMF-G2 Bridge, and a SMF Bridge as a TP module doesn't makes sense to me.
waiting of course ... ::) but i not needed full and complete sources :coolsmiley:. i want see conseptual xml implementation only 8), for example. i want make integration custom modules easy and transparent, without big changings as now :laugh:. but if mechanism is very drafting or in mind only - waiting ... ???
gallery as bridge not like to me :tickedoff:. i want embedding gallery in portal (this empty point present in TP 0.9x). reason: for general sitemap with general administration and moderation of hide/show suggestion and permissions, support general taggings, bookmarks, user and group statistics, others ...
Gallery2 have docs for "embedding" in other apps (have briges too). next reason - one of developers is nicEdit author ;) ;D
just edit the Oldies' Bridge a bit and you'll get the blocks If I am right.
Dragooon, thanks. soon!