close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

hidden vs live records

Thread began 7/03/2014 6:39 am by Jamie | Last modified 7/09/2014 2:18 pm by Jason Byrnes | 983 views | 9 replies |

Jamie

hidden vs live records

Hi Jason

I am trying to get an news/blog archive menu working - it works fine until you start hiding articles.

If you hide (Live = 0) the first record, then the whole menu is hidden (and the 'No archive at present' message is displayed)
If you keep the first record live (Live = 1) and set one of the other records to hidden, the menu shows but still shows the record that has been set to hidden.

Would really appreciate any help getting this working.

Many thanks

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

The if statement is around the recordset loop:

<?php if ("".($Archive->getColumnVal("Live"))  ."" == "1") { ?>
<?php
while(!$Archive->atEnd()) {
?>
<div style="line-height:150%;font: 16px Arial, Helvetica, sans-serif;color:#fff; margin:0 20px;"><a href="newsarchive.php?NewsMonth=<?php echo($Archive->getColumnVal("ContentMonth")); ?>&NewsYear=<?php echo($Archive->getColumnVal("ContentYear")); ?>"> <?php echo($Archive->getColumnVal("contDate")); ?> (<?php echo($Archive->getColumnVal("cc")); ?>)<br/>
</a></div>
<?php
$Archive->moveNext();
}
?>
<?php } ?>




it needs to be inside the recordset loop instead:

<?php
while(!$Archive->atEnd()) {
?>
<?php if ("".($Archive->getColumnVal("Live")) ."" == "1") { ?>
<div style="line-height:150%;font: 16px Arial, Helvetica, sans-serif;color:#fff; margin:0 20px;"><a href="newsarchive.php?NewsMonth=<?php echo($Archive->getColumnVal("ContentMonth")); ?>&NewsYear=<?php echo($Archive->getColumnVal("ContentYear")); ?>"> <?php echo($Archive->getColumnVal("contDate")); ?> (<?php echo($Archive->getColumnVal("cc")); ?>)<br/>
</a></div>
<?php } ?>
<?php
$Archive->moveNext();
}
?>
Sign in to reply to this post

Jamie

brilliant. thanks Jason

that works now but the 'No archive at present' message is displayed for any month in which a record is marked as hidden (even if there is one marked as live).

Sign in to reply to this post

Jason ByrnesWebAssist

your if statement will only look at the first record:
<?php if ("".($Archive->getColumnVal("Live")) ."" != "1") { ?>
No archive at present
<?php } ?>

you would need to loop through the recordset to determine if there are any live records, for example:

<?php 
$anyLive = "0";
while(!$Archive->atEnd()) {
if($Archive->getColumnVal("Live") == "1") {
$anyLive = "1";
}
$Archive->moveNext();
}
$Archive->moveFirst();
?>
<?php if ("".($anyLive) ."" != "1") { ?>
No archive at present
<?php } ?>
Sign in to reply to this post

Jamie

hope you're off having a great 4th July!

Thanks re the above, 'fixing that' has now created a couple subsequent issues:

1. if you have 2 records in a month. if the first is live but the second is hidden then nothing for that month is showin in the archive menu.

2. if you have the same 2 records but the first is hidden and the second is live then that month is shown but it shows 2 enties in the () rather than just 1

3. on the target page (newsarchive.php -attached) if same 2 records as in point 1 are there (ie 1st hidden, 2nd live) then the target page shows 'no articles' message

4. on the target page (newsarchive.php -attached) if same 2 records as in point 2 are there (ie 1st live, 2nd hidden) then the target page showsboth records rather than just the live one

sorry about this

Cheers

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

Jamie

see PM

Sign in to reply to this post

Jason ByrnesWebAssist

Please provide a Skype username or a US phone number and a good time to contact you when you will be in front of your computer and we will have an engineer contact you to resolve this issue over the phone.

We are available Monday - Friday from 9am - 4pm EST (except major U.S. holidays).

Sign in to reply to this post

Jamie

As ever Jason... you da man!

Thanks for your help and helping me find the simpler way!

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

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...