close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

show if problem

Thread began 2/28/2013 7:14 am by JamieEff | Last modified 2/28/2013 7:54 am by JamieEff | 2153 views | 2 replies |

JamieEff

show if problem

Hey Jason

Am struggling to get a show if to work.

Basically I have this content:

php:
<strong><?php echo $row_Event['EventTitle']; ?></strong>
                        <?php echo(str_replace(array("<p>","</p>","<blockquote>","</blockquote>","<strong>","</strong>","<em>","</em>","<u>","</u>"),"",substr(preg_replace("/<img[^>]+\>/i"" ",$row_Event['EventContent']),0,250))."..."); ?>



In the table there is a column HideEvent which is either 0 (visible) or 1 (invisible)

Once I have created the show if I have this:

php:
<?php
  
if ("".$row_Event['HideEvent']  ."" == "0") {  // WebAssist Show If
?>
                        <strong><?php echo $row_Event['EventTitle']; ?></strong>
                        <?php echo(str_replace(array("<p>","</p>","<blockquote>","</blockquote>","<strong>","</strong>","<em>","</em>","<u>","</u>"),"",substr(preg_replace("/<img[^>]+\>/i"" ",$row_Event['EventContent']),0,250))."..."); ?>
                        <?php
  
// ("".$row_Event['HideEvent']  ."" == "0")
?>



but whether I toggle the HideEvent column to 0 or 1 no content shows

Thanks

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

if you echo the hide event value to the page:

php:
<?php echo($row_Event['HideEvent']); ?>



does it show the expected 1 or 0 value?

Sign in to reply to this post

JamieEff

sorry Jason.... been a dip, was using the wrong connection on the recordset:o

Sign in to reply to this post

JamieEff

I have another show if issue and this time the connection is right (well pretty sure!! ;) )...

heres the show if with the content and basically it hides all content within it:

html:
<?php do { ?>
<?php
if ("".$row_NewsRS['Live'] ."" == "1") { // WebAssist Show If
?>
<div style="clear:right;">
<!-- title start //-->
<div style="float:left;width:480px;margin:20px 0 0 0;"> <a href="newsarticle.php?ID=<?php echo $row_NewsRS['NewsID']; ?>-<?php echo(str_replace(array(" "),"_", $row_NewsRS['NewsTitle'])); ?>"> <?php echo $row_NewsRS['NewsTitle']; ?> </a> </div>
<!-- title end //-->
<div style="float:right;margin:20px 3px 0 0;background-color:#19172F;color:#fff;padding:5px 20px;"> <?php echo(date("d/m/Y",strtotime($row_NewsRS['NewsDate']))); ?> </div>
<div style="clear:right;">
<div style="float:left;margin:10px 0 0 0;min-width:500px;">
<!-- description start //-->
<?php echo(str_replace(array("<p>","</p>","<blockquote>","</blockquote>","<strong>","</strong>","<em>","</em>","<u>","</u>"),"",substr(preg_replace("/<img[^>]+\>/i", " ",$row_NewsRS['NewsContent']),0,250))."..."); ?>
<!-- description end //-->
</div>
</div>
</div>
<div style="clear:right;height:30px;"></div>
<?php
} // ("".$row_NewsRS['Live'] ."" == "1")
?>
<?php } while ($row_NewsRS = mysql_fetch_assoc($NewsRS)); ?>



I have tried to echo the hide event using

html:
<?php echo($row_NewsRS['Live']); ?>



but that shows nothing as well....

Sign in to reply to this post

Jason ByrnesWebAssist

if the echo shows nothing, the problem is in the recordset...

if the echo doesn't work, the show if wont work

sooooo, whats the recordset?

Sign in to reply to this post

JamieEff

i think i may have this one sussed... the recordset looked as if it had a extra data in it from a previous version of the recordset.. can that happen?

Sign in to reply to this post

Jason ByrnesWebAssist

yes, that can sometimes happen.

Sign in to reply to this post

JamieEff

oki doki thanks Jason

basically I am using thi son news page so that the client can add a news item and 'hide' it until they are ready to 'publish' it

that works fine with the list of news articles on the news page itself, but on every page I have a 'latest news' panel which uses the most recent article from the news list

how would I stop the panel section from showing a blank space if the most recent article is 'hidden' and get it to actually show the most recent visible article?

does that make sense?

Sign in to reply to this post

Jason ByrnesWebAssist

no, i'm sorry, that doesn't make sense, please provide more details

Sign in to reply to this post

JamieEff

ok

if you look at this page: news.php

I have used DA to create the update, insert pages that populate the content for the news 'feed'

I have added a column to the table called 'Live' which is controlled by a checkbox.. if the checkbox is checked, this = 1 and makes the content 'Live' on the news page, if the checkbox is not checked, this = 0 and makes the content disappear

so, if the client is creating content but doesnt want it to show (sort of saving the content) they can set the content to = 0 and not show. But if it is the most recent article, the latest news panel on the left hand column shows an empty space

so am trying to see if there is a way to allow the news panel section to show the most recent VISIBLE content so that it always has content in it....

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...