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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,989
  • Total Topics: 21,322
  • Online today: 1,228
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 935
  • Total: 935

TP Dummy Mod

Started by KapaBG, February 14, 2008, 01:31:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dragooon


KapaBG

#11
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

Tiny Portal/TP Dummy main tab

Tiny Portal/TP Dummy settings tab

Tiny Portal/TP Dummy advanced tab :)

TP Dummy Manager view

Profile items of dummys

have a fun :laugh:

KapaBG

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;">&nbsp;</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 ---


KapaBG

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 O0
at now, main problems for me - can't view new TP sources TP telepathically :2funny:

Zetan

You'll have to wait like the rest.. it isn't finished yet.

Dragooon

There already is a SMF-G2 Bridge, and a SMF Bridge as a TP module doesn't makes sense to me.

KapaBG

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

Dragooon

#17
just edit the Oldies' Bridge a bit and you'll get the blocks If I am right.

KapaBG

Dragooon, thanks. soon!

This website is proudly hosted on Crocweb Cloud Website Hosting.