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

Recent

Welcome to TinyPortal. Please login or sign up.

May 05, 2024, 05:11:15 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,178
  • Total Topics: 21,220
  • Online today: 232
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 207
  • Total: 207

Externe Seite einbinden

Started by Netsnoop, September 04, 2006, 07:11:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Netsnoop

Hallo,


ich habe mir eine Gallery installiert und wollte mal wissen wie ich diese in die Mitte meiner Seite geladen bekomme? Bei den Links der anderen Seiten steht immer ...index.php?action=...... was hat das damit aufsich bzw. wo kann ich was nachtragen das ich den externen Link auch so aufrufen könnte?



MfG Netsnoop

Nordin

Hallo mein Freund ;) ...

Ich kann dir helfen... also:

1. neue Datei "Sources/Gallery.php" mit folgenden Inhalt anlegen:<?php
if (!defined('SMF'))
die(
'Hacking attempt...');

Function 
Gallery()
{

global  $txt$scripturl,  $db_prefix$context;
LoadTemplate('Gallery');
$context['page_title'] = "Diesen Text kannst du in der /Sources/Gallery.php ÃƒÆ'Ã,¤ndern ;0)";
$context['linktree'][] = array(
'url' => $scripturl '?action=gallery',
'name' => $txt['gallery']
);

}

?>


2. neue Datei "Themes/xxx/Gallery.template.php" mit folgenden Inhalt anlegen:
Quote<?php
// Version: 1.1 RC3; Gallery

function template_main()
{
   global $context, $settings, $options, $txt, $scripturl;

   echo '
   <script language="JavaScript" type="text/javascript"><!--
      function checkAll(onOff)
      {
         for (var i = 0; i < document.searchform.elements.length; i++)
         {
            if (document.searchform.elements.name.substr(0, 3) == "brd")
               document.searchform.elements.checked = onOff;
         }
      }
   // --></script>
   <form action="', $scripturl, '?action=search2" method="post" name="searchform" id="searchform">

<script type="text/javascript"><!--

/***********************************************
* IFrame SSI script II- ÂÃ,© Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don\'t support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids)
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids] : document.getElementById(iframeids)
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

// --></script>

      <table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" class="tborder">
         <tr class="titlebg">
            <td>Galerie</td>
         </tr><tr>
            <td class="windowbg">';

               // load the gallery
               echo '<iframe id="myframe" src="LINK TO YOUR GALLERY" scrolling="auto" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:novisible; width:100%; display:none"></iframe>';

   echo '
            </td>
         </tr>
      </table>
   </form>';
}

?>
ACHTUNG: Link zur Gallery einfügen!!

3. Add "Themes/xxx/index.template.php"

find: // Show the [forum] button.
echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action=='forum' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=forum">'.$txt['tp-forum'].'</a>
</td>' , $current_action=='forum' ? '<td class="maintab_active_last">&nbsp;</td>' : '';


after add: // How about the [gallery] button?
    echo ($current_action == 'gallery' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
        <td valign="top" class="maintab_' , $current_action == 'gallery' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=gallery">Galerie</a>
</td>' , $current_action == 'gallery' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


find: if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin')))

after add: if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin', 'gallery')))


4. Add "index.php"

find: 'findmember' => array('Subs-Auth.php', 'JSMembers'),

after add:        'gallery' => array('Gallery.php', 'Gallery'),



Ich hoffe ich hab nichts vergessen und konnte dir helfen. Also wenn mal Probleme hast schick mir nen Link zum Beitrag ich kann ab und zu auch helfen... also peace  :coolsmiley:




Netsnoop

Yoo, THX weiss zwar nich woher du das hast, aber es funzt... :)

Nordin

loool
Quote from: Netsnoop on September 12, 2006, 09:56:49 AM
Yoo, THX weiss zwar nich woher du das hast, aber es funzt... :)

Teile gefunden und Teile selber geschrieben... selbst ist der Mann!

Inferno

also ich hatte von smf die gallery runter geladen und es hat gereicht, dass man index.php?action=gallery gemacht hat, schon ist die gallery in der Mitte gewesen

Minas

Danke für die Anleitung Nordin. Hab das auch mal ausprobiert da ich ein paar Seiten habe die ich einbinden wollte. Das Problem ist nur es funktioniert genau 1x. Wenn ich eine weitere Seite einfügen will (und alles entsprechend geÃÆ'Ã,¤ndert habe) bekomme ich immer die Fehlermeldung Kann das 'main' Template nicht laden.

Nordin

steht doch was oben im quellcode dazu..

Quote//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
Quote
Also quasi erweitern...