Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: How to use a different main page other than default  (Read 9574 times)

0 Members and 1 Guest are viewing this topic.

jgsketch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 47
How to use a different main page other than default
« on: October 01, 2005, 10:15:22 pm »

I would like to change the default index page to another page in coppermine, such as the register or login page. How can I change the default index page like this. My search only told me how to have a seperate index page outside of coppermine by having a subfolder on the server for coppermine. But what I'm trying to do is to still use a coppermine page with it's menus and theme. Thanks for the help.
« Last Edit: October 02, 2005, 08:54:25 am by Stramm »
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: How to use a different main page other than default
« Reply #1 on: October 01, 2005, 10:40:18 pm »

jg,

Nothing like the simple... right? ;)  Okay, the simplest method would be to see if your webhost has a redirect option, where anyone going to your domain would get redirected to another page.  And that redirected page would be : 

Quote
http://Http://www.jgsketchsimplegallery.com/cpg/login.php

If you don't have that option, check with your webhost if you can use .htaccess files on your site.  If so, you simply need to create a new file with your notepad or text editor and enter  the following:

Quote
DirectoryIndex login.php index.php

Then save the file as .htaccess


Dennis
Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: How to use a different main page other than default
« Reply #2 on: October 01, 2005, 10:41:35 pm »

you'll have to edit index.php

Code: [Select]
find if (isset($HTTP_GET_VARS['cat'])) {
    $cat = (int)$HTTP_GET_VARS['cat'];
after it the } ... delete it

scroll down to the end and just before
Code: [Select]
?>add
Code: [Select]
}else{ // no cat, we display the main
pageheader($BREADCRUMB_TEXT ? $BREADCRUMB_TEXT : $lang_index_php['welcome']);

<<<EOT


here you add your startpage content<br><br>
<p>htnl is of course allowed</p>


EOT;
    pagefooter();
    ob_end_flush();


}

Should work but I haven't tried. Necessary to open the standard startpage is to call it with index.php?cat=0
Album list in the menu is already doing this but not breadcrumb


to change this find in functions.inc.php  (2 occurances)
Code: [Select]
               $breadcrumb = '<a href="index.php">'.$lang_list_categories['home'].'</a>';and replace with
Code: [Select]
               $breadcrumb = '<a href="index.php?cat=0">'.$lang_list_categories['home'].'</a>';
as said...  no guarantees and backup the files before you modify them

edit... to late and admitted, yours is easier ;) but I didn't want to throw that into the bin after all the typing

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: How to use a different main page other than default
« Reply #3 on: October 01, 2005, 10:49:39 pm »

Quote
edit... to late and admitted, yours is easier Wink but I didn't want to throw that into the bin after all the typing

Actually, if yours works that would be a nice first step in resolving my feature request.  :)
Now if you could just add the code to include it as an option in the admin menu...(kidding, well somewhat, okay maybe not).

Another message thread to add to my bookmarks, thanks Stramm.

Dennis

Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

jgsketch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 47
Re: How to use a different main page other than default
« Reply #4 on: October 01, 2005, 10:53:55 pm »

Thanks for the help guys. I'll look into the code option, but like the simplicity of the redirect. Do you think that would have any adverse effects on SEO? I would assume not, I think the robots would follow the redirect like a user would. But I'm not sure.
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: How to use a different main page other than default
« Reply #5 on: October 01, 2005, 11:05:26 pm »

Now if you could just add the code to include it as an option in the admin menu...

hahahaha... but that'll be the easy part  8)

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: How to use a different main page other than default
« Reply #6 on: October 01, 2005, 11:12:15 pm »

Thanks for the help guys. I'll look into the code option, but like the simplicity of the redirect. Do you think that would have any adverse effects on SEO? I would assume not, I think the robots would follow the redirect like a user would. But I'm not sure.

It's just 34 characters in a text file, including spaces.  Try it, test it.  If it doesn't do the trick. Delete.  C'mon JG.. you can do it... ! JG! JG! JG!  ...   ;)

Sometimes, I think the best part about giving suggestions is that you can test things out without messing with your own setup.  ;)

Dennis
Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to use a different main page other than default
« Reply #7 on: October 02, 2005, 11:21:34 am »

come on, that's bullsh** - who needs the login page as start page? Even logged in users will be directed to it. Just tweak you gallery a bit and send all unlogged users to your login page. Preferably, just apply this little hack: http://coppermine.sourceforge.net/faq.php#registeredUsersOnly
Logged

jgsketch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 47
Re: How to use a different main page other than default
« Reply #8 on: October 02, 2005, 05:25:26 pm »

GauGau
I was just using those pages as an example...
such as the register or login page.
Or any other page for that matter. I've decided to use the rateme page as my start page.

madeinhawaii
I'm going to try the code today. My site was down yesterday and this morning. I've decided to throw out the "simple". I have too much going on, on my site now.  :)
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: How to use a different main page other than default
« Reply #9 on: October 02, 2005, 08:55:03 pm »

Quote
I'm going to try the code today. My site was down yesterday and this morning. I've decided to throw out the "simple". I have too much going on, on my site now.   

I empathize with you.  With all the great features, mods, hacks, and add-ins, who can resist? Success with one mod, makes you take the next challenge.  When friends and family see what you are doing, you look like a genius.  It's just all too addictive. 

Dennis

Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

jgsketch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 47
Re: How to use a different main page other than default
« Reply #10 on: October 02, 2005, 10:36:50 pm »

Ok, I got to try the code today. It worked to a certain extent. The code
Code: [Select]
}else{ // no cat, we display the main
pageheader($BREADCRUMB_TEXT ? $BREADCRUMB_TEXT : $lang_index_php['welcome']);

<<<EOT


here you add your startpage content<br><br>
<p>htnl is of course allowed</p>


EOT;
   pagefooter();
   ob_end_flush();


}
Did not show the content provide. I tried adding my own content and nothing showed up. Just my header footer and menues. I'm sorry, but I'm not that good with PHP yet, what is EOT?

I will try some more tinckering to see what I can do. Could I use an include to put the content of the page I want to show up? Most likely the Rateme.php file.
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: How to use a different main page other than default
« Reply #11 on: October 02, 2005, 11:56:54 pm »

uhps... should read

Code: [Select]

echo <<<EOT


the EOT isn't important... important is the <<<. It's called heredoc and after it usually is an identifier. You could replace EOT with YADDA if you want. Heredoc text behaves like a double quote text... just with no double quotes. So it's very comfortable to write html in here. Advantage is that variables get expanded.

Example:
<table align="center"><tr><td>>Your username:{USER_NAME}</td></tr></table>

So now you should know what to do


EOT;


jgsketch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 47
Re: How to use a different main page other than default
« Reply #12 on: October 03, 2005, 12:07:43 am »

Works great. And thanks for explaining the EOT, I see how that comes in handy. Thanks! ;D
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to use a different main page other than default
« Reply #13 on: October 03, 2005, 08:15:06 am »

Actually, it's not the letters "EOT" that do the magic, but the syntax relies on the use of the <<< chars. The letters EOT are just made up, but it has become best practise to use them - they're short for "end-of-transmission", an expression borrowed from telecomunications.
Code: [Select]
echo <<< FOOBAR
<p>Hello World</p>
FOOBAR;
would work just the same way. To find out details about this so-called "heredoc" syntax, go to http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

HTH

Joachim
Logged

jgsketch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 47
Re: How to use a different main page other than default
« Reply #14 on: December 30, 2005, 04:24:36 pm »

I had a hard time making this work with 4.2. I kept getting unepected T errors. I ended up putting back the } after the
Code: [Select]
if (isset($_GET['cat'])) {
        $cat = (int)$_GET['cat'];

I then got rid of the
Code: [Select]
}else{ // no cat, we display the main
pageheader($BREADCRUMB_TEXT ? $BREADCRUMB_TEXT : $lang_index_php['welcome']);

That got rid of the unexpected T errors and the content showed up. However, I'm now stuck trying to get the content to show above the Album List. Actually, I would prefer to get rid of the album list off the main page but keep the "Last Updated" and "Top Rated" blocks. I think there are two ways to go about it, just not sure where in the code to place my code.
 
One: I think I could keep the
Code: [Select]
pageheader($BREADCRUMB_TEXT ? $BREADCRUMB_TEXT : $lang_index_php['welcome']); code out leaving me with just the content I want to insert, then I would have to figure out where to place the rest of the code so that it shows up above the rest of the blocks in the index.php.

Two: I think I could reinsert the
Code: [Select]
pageheader($BREADCRUMB_TEXT ? $BREADCRUMB_TEXT : $lang_index_php['welcome']); code and then I would just have the content show up and no other items. I could then add the other blocks such as "Last updated" and "Top Rated" blocks and keeping the album list off the index.php.

I've gone as far as I could on my own, even trying different code placements to get it right. I need a little direction on this one. Thank you.

Not sure if this should have been moved to the 4.2 forum or left intact.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to use a different main page other than default
« Reply #15 on: December 30, 2005, 08:54:19 pm »

shouldn't have gone into a cpg1.3.x thread that is marked as solved  ::)
Logged

jgsketch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 47
Re: How to use a different main page other than default
« Reply #16 on: December 31, 2005, 02:33:08 am »

Sigh... Sorry, trying not to open two threads on the same topic even though the new question involves 4.2. I'll post in 4.2 thread?
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 19 queries.