Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Pages: [1] 2

Author Topic: Special page instead of  (Read 15448 times)

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
Special page instead of
« on: October 18, 2006, 09:47:44 am »

Thanx Keyrocks I found better lightbox gallery solution in Thickbox (30k is much much less than 110k). But I still dont wanna have 30k javascript in header of non gallery pages. So I made the copy of index.php and renamed it to gallery.php and I replaced with my thickbox code. Than I made fixed links to the gallery.php. I dont wanna edit gallery.php manualy. I need it takes data from DB, for exampla from page with its fixed ID, This page will be editable trought administration like every pages and articles.

Thankx a lot (sNews 1.5)
Logged
I like sNews!

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Special page instead of
« Reply #1 on: October 18, 2006, 10:23:20 am »

how many pages do you have that need the gallery?

If only one, why not hide the js using php until the gallery page is called...?

Of course, if there is more than one gallery page, it becomes a lot more complex!!
Logged
Of all the things I have lost, it is my mind that I miss the most.

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
Special page instead of
« Reply #2 on: October 18, 2006, 10:31:59 am »

just one... :) how to do it please?
Logged
I like sNews!

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Special page instead of
« Reply #3 on: October 18, 2006, 11:32:08 am »

Code: [Select]
// To use category to determine if something is to be shown on the page
// Use the sef title for the category. Replace "gallery" with your sef title,
// but keep the quotes.

$sef_for_Display="gallery";

///////////////////////////
if ($_GET['category']==$sef_for_Display."/") { ?>

Paste your script in here

this would go into the index.php, with your javascript inside it.

[added] You would create a category called, for eg, Gallery, which uses the sef-title gallery.
You would then create an article that has the sole(perhaps) purpose of including your gallery script.

So, any article that you assign to the Gallery category, will load that script, but no other page will do so.
Logged
Of all the things I have lost, it is my mind that I miss the most.

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
Special page instead of
« Reply #4 on: October 18, 2006, 11:58:15 am »

Thanks a lot!
Logged
I like sNews!

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
Special page instead of
« Reply #5 on: October 18, 2006, 12:51:06 pm »

I think (maybe I dont think with my head...) your script is missing something... im testing to add echo...
or I dont know, but its not working


something like:

  \\ Some category specific PHP/HTML here


???
Logged
I like sNews!

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
Special page instead of
« Reply #6 on: October 18, 2006, 01:18:39 pm »

I really dont know, it wont work...
Logged
I like sNews!

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Special page instead of
« Reply #7 on: October 18, 2006, 01:53:07 pm »

Quote from: oniip
I think (maybe I dont think with my head...) your script is missing something... im testing to add echo...
or I dont know, but its not working


something like:

  \\ Some category specific PHP/HTML here


???
eh?
Where did that come from...?

What version of snews are you using (should have asked this first)
Logged
Of all the things I have lost, it is my mind that I miss the most.

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Special page instead of
« Reply #8 on: October 18, 2006, 01:55:55 pm »

to test using echo (tho it is not necessary),
you replace the line

Code: [Select]
Paste your script in herewith
Code: [Select]
Logged
Of all the things I have lost, it is my mind that I miss the most.

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
Special page instead of
« Reply #9 on: October 18, 2006, 02:00:52 pm »

I put in index.php your code but it didnt work... so I used google for syntax in php using IF.... thats it....I didnt use the written (by me) code (it was for wordpress)...

Im using sNews 1.5.26

Thanx and sorry for misunderstood
Logged
I like sNews!

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
Special page instead of
« Reply #10 on: October 18, 2006, 02:10:53 pm »

This is the code I used but isnt working. I created Gallery cattegory with SEF galeriatb

Code: [Select]
// To use category to determine if something is to be shown on the page
// Use the sef title for the category. Replace "gallery" with your sef title,
// but keep the quotes.

$sef_for_Display="galeriatb";

///////////////////////////
if ($_GET['category']==$sef_for_Display."/") { ?>




PS:in my test site it is Lightbox, but deffinitely it will be Thickbox!
Logged
I like sNews!

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Special page instead of
« Reply #11 on: October 18, 2006, 02:22:33 pm »

hmm, the code I pasted works for me.

What you have posted is using alternative syntax:-
http://au.php.net/manual/en/control-structures.alternative-syntax.php
regular syntax for IF:-
http://au.php.net/manual/en/language.control-structures.php#control-structures.if

Your use of the alternate is what threw me out.

this is the top section of my index.php
Code: [Select]










// To use category to determine if something is to be shown on the page
// Use the sef title for the category. Replace "gallery" with your sef title,
// but keep the quotes.

$sef_for_Display="gallery";

///////////////////////////
if ($_GET['category']==$sef_for_Display."/") { ?>

Paste your script in here


I have made a category called Gallery, with sef_title  gallery.
I have made an article which I have assigned to the Gallery category.

When I go to the link Gallery, I get the text Paste your script in here
(as shown above) displayed on the Gallery page.

It is that text that you would ultimately replace with your javascript...
Logged
Of all the things I have lost, it is my mind that I miss the most.

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
Special page instead of
« Reply #12 on: October 18, 2006, 02:31:18 pm »

But I put it between ...
You have it between ...
??? I used it like you, no success....
Logged
I like sNews!

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Special page instead of
« Reply #13 on: October 18, 2006, 02:38:28 pm »

yep, ok...
I developed and tested on local server...
just tried it online, and it isn't doing as expected.
Logged
Of all the things I have lost, it is my mind that I miss the most.

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
Special page instead of
« Reply #14 on: October 18, 2006, 02:39:05 pm »

My code:
Code: [Select]

















// To use category to determine if something is to be shown on the page
// Use the sef title for the category. Replace "gallery" with your sef title,
// but keep the quotes.

$sef_for_Display="galeriatb";

///////////////////////////
if ($_GET['category']==$sef_for_Display."/") { ?>






my site: http://www.aval.onio.sk and when you click on GALERIA (sef galeriatb) its not working...
Logged
I like sNews!
Pages: [1] 2