Author Topic: How to block something from showing?  (Read 646 times)

0 Members and 1 Guest are viewing this topic.

Offline vinnierTopic starter

  • Enthusiast
  • Posts: 56
    • View Profile
How to block something from showing?
« on: March 14, 2010, 11:35:17 AM »
Hi,

Here is the situation, I have php script implemented into 2 pages, on one page I need it the way it is cause it's the main page but on the other page I would like to use only a part of it, sort of a preview.
How do I block the text from showing? Just so I can copy,paste how of the text in the script and it won't show on the preview webiste.

Thanks in advance.

Offline DaiLaughing

  • Enthusiast
  • Posts: 111
    • View Profile
    • Learn HTML, XHTML, CSS, Javascript, PHP and MySQL - Your Web Skills
Re: How to block something from showing?
« Reply #1 on: March 14, 2010, 01:09:44 PM »
I don't think I understand what you mean but could some of the content have a class (notonpreview or something) and then on the preview page you have a stylesheet which has display:none for that class?  As the main page doesn't have that stylesheet it would show all the content and ignore the class=notforpreview.

Offline vinnierTopic starter

  • Enthusiast
  • Posts: 56
    • View Profile
Re: How to block something from showing?
« Reply #2 on: March 14, 2010, 01:13:51 PM »
Looks like you understood me correctly :) Thanks for the reply and it would actually work and I was thinking about something similar myself but the problem with it is that the script is loaded from another site form the script provider so I can't edit it.
That's why I am looking for a way to block the plain text from preview...

Offline DaiLaughing

  • Enthusiast
  • Posts: 111
    • View Profile
    • Learn HTML, XHTML, CSS, Javascript, PHP and MySQL - Your Web Skills
Re: How to block something from showing?
« Reply #3 on: March 14, 2010, 01:33:35 PM »
You could use the same concept but make ALL P tags display:none; on the preview page.  Then override that for your own text by applying a class to them which would not be on the other content.

Offline vinnierTopic starter

  • Enthusiast
  • Posts: 56
    • View Profile
Re: How to block something from showing?
« Reply #4 on: March 14, 2010, 02:00:42 PM »
Never thought about that! Thanks!

Offline cs.punk

  • Enthusiast
  • Posts: 406
  • Gender: Male
  • Uhm er well...
    • View Profile
Re: How to block something from showing?
« Reply #5 on: March 16, 2010, 07:07:40 AM »
Rather than loading the data and setting it to not show why not make it not load at all?
For example

main.php

// bla bla

echo "$title";
echo 
"$rating";
echo 
"$photo";


list.php

// bla bla

echo "$title";
echo 
"$photo";


:)
Life isn't just simply being alive... Or is it?