Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Wrapper AND standalone theme  (Read 3956 times)

0 Members and 1 Guest are viewing this topic.

darkpollo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 73
Wrapper AND standalone theme
« on: March 20, 2006, 03:50:17 pm »

Hi.
i´m trying to do a theme that shows the logo when it is standalone and that hide it when it is inside the joomla wrapper.

Do you know how to do that (if is it possible to do)?
Thanks
« Last Edit: March 23, 2006, 10:19:18 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Wrapper AND standalone theme
« Reply #1 on: March 20, 2006, 05:04:35 pm »

we have no idea what code you have to apply to do Joomla stuff. Generally speaking, you can't make a static banner (using plain html) in themes/yourtheme/template.html then, but you have to apply some PHP script magic. To do so, use the custom_header function of Coppermine, make it point to some PHP script (e.g. "mybanner.php") that has something like this in is (Pseudo-Code, not ready for copy and paste):
Code: [Select]
<?php
if ($some_var_exists_that_makes_the_script_know_it_is_wrapped == TRUE) {
    
// hide the banner, i.e. do nothing
} else {
    print 
'<img src="path/to/custom/banner.jpg" border="0" alt="" />'// this get's printed when not wrapped
}
?>
Logged

darkpollo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 73
Re: Wrapper AND standalone theme
« Reply #2 on: March 20, 2006, 06:59:57 pm »

I think i got it.

Reading this guide to wrap an SMF theme i have found the code we need. :D

http://www.technoadvice.com/advanced/developer/modify_an_smf_theme_for_joomla_and_mambo.html
Code: [Select]
First, we remove anything from the theme we don't want to show up when wrapped using this code:
Code:
if (empty($_REQUEST['option'])){
}

If we want something to show up only when it is wrapped, we would use the following code:
Code:
if (!empty($_REQUEST['option'])){
}

First we use that code to remove excess <html> and <body> tage, and the <head> section. Then we remove unwanted theme elements (headers, logos, etc.) Then we remove existing CSS, and put it in a separate file that is loaded only when accessed unwrapped.

My problem was that i had an html, but if i understood you right i need to modify the php file not the template.html.
I was thinking to modify the theme.php, you tell my to create a new php file and call it as custom_header.
WHat do you think its better?
Thanks.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Wrapper AND standalone theme
« Reply #3 on: March 21, 2006, 06:43:48 am »

Your choice. Imo using the custom_header is easier to keep things separated.
Logged

darkpollo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 73
Re: Wrapper AND standalone theme
« Reply #4 on: March 21, 2006, 11:50:16 pm »

Help again. I have everything but it is not working...
 ???
I did a file named header.php and set it on the top of the page.
Here is the code:
Code: [Select]
<?php


if (empty($_REQUEST['option'])){


?>

<HTML>
<table width="100%"  height="" border="0" align="center" cellpadding="0" cellspacing="0">

    <tr>

    <td><img src="../motos/templates/247portal-b-red/images/space.gif" width="770" height="1" /></td>

  </tr>

<tr>

      <td><div class="background">

        <table width="100%"  border="0" cellpadding="0" cellspacing="0" background="../motos/templates/247portal-b-red/images/center.jpg">

          <tr>

            <td width="26"><img src="../motos/templates/247portal-b-red/images/left.jpg" width="26" /></td>

            <td class="title">              <table width="100%"  border="0" cellspacing="0" cellpadding="0">

              <tr>

                <td height="100" colspan="2" class="title" style="padding-top:14px;"><table width="100%" border="0" cellpadding="0" cellspacing="0">

                    <tr>

                      <td width="100%" style="padding-left:10px;"><a href="../motos" title="{GAL_NAME}">{GAL_NAME}</a></td>

                      <td></td>

                    </tr>

                </table></td>

              </tr>

              <tr>

                <td width="400" height="29"><div id="search">

                   

                </div></td>

                <td width="100%" height="29" valign="bottom" class="mainlevel-nav"></td>

              </tr>

            </table></td>

            <td width="26"><img src="../motos/templates/247portal-b-red/images/right.jpg" width="26" /></td>

          </tr>

        </table></HTML>

<?php

}
?>
   

But it is not working. The joomla link: http://todo-motos.es/motos/index.php?option=com_wrapper&Itemid=31
The gallery link:  http://todo-motos.es/public/



Could you help me?
« Last Edit: March 22, 2006, 12:12:04 pm by darkpollo »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Wrapper AND standalone theme
« Reply #5 on: March 22, 2006, 07:22:54 am »

Could you help me?
No, sorry. I have no idea about Joomla, as I already told you.
Logged

darkpollo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 73
Re: Wrapper AND standalone theme
« Reply #6 on: March 22, 2006, 12:11:25 pm »

Thanks anyway! :D

I will search a php or html code that detects if a page is inside a wrap... if exists...  ;D

The Joomla code doesnt work cause cpg is inside a wrap. I need to make a component to add the cpg or search the code.

I hope this post help anyone.
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 15 queries.