Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8043599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:57:16+00:00 2026-06-05T04:57:16+00:00

I am generating a list from sql server, filtering it based on new and

  • 0

I am generating a list from sql server, filtering it based on new and old records and displaying them in their respective categories on the webpage. I want to show unique list bullets for old and new records. What Im currently getting is a mashup of every record from each category on top of eachother. The icons for the list items are coming from some twitter bootstrap css, using glyphicons. The new records also have a popover that displays on hover. The list-generating code

foreach($resultArray as $category_name => $items)
{
    echo '<h3>'. $category_name.'</h3><ul>';
foreach($items as $itemid => $itemDetails)
    {
    ?>
    <li class="<?php if(strtotime($itemDetails['posted']) > (strtotime('-30   days'))){echo 'icon-star';} else {echo '';} ?>" data-content="This item is new on Corkboard. Check it out!" data-original-title="New Item">
    <?php 
echo '<a href="newGenView.php?id='.$itemid.'">'.$itemDetails['name'].' - '.$itemDetails['description'].'</a>';
    ?>
    </li>
<?php
}//foreach
echo '</ul>';
}//foreach
?>

And, I have these script tags:

<script type="text/javascript" src="assets/js/bootstrap-popover.js"></script> 
<script type="text/javascript">
$(document).ready(function() {
    $(this).popover(options);
});
</script>

Any ideas or other ways to do this solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:57:18+00:00Added an answer on June 5, 2026 at 4:57 am
    • Don’t forget the bootstrap-tooltip.js, which is required for popover.
    • Only add the data-content attributes to the new <li>.
    • The selector for popover should be for the <li>s and remove parameter options, if you don’t initialize it.
    • I would move the icons into <i> like in the bootstrap description.
    • I’ve added some styling rules.

    The final html could be:

    <!DOCTYPE html>
    <html>
    <head>
        <link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
        <style type='text/css'>
            ul { list-style: none inside none; margin: 0; }
            li { display: inline; }
        </style>
        <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
        <script type='text/javascript' src="http://twitter.github.com/bootstrap/assets/js/bootstrap-tooltip.js"></script>
        <script type='text/javascript' src="http://twitter.github.com/bootstrap/assets/js/bootstrap-popover.js"></script>
        <script type='text/javascript'>
            $(document).ready(function() { $('li').popover(); });
        </script>
    </head>
    <body>
        <h3>category_name</h3>
        <ul>
            <li>
                <i class="icon-minus"></i>
                <a href="newGenView.php?id=1">name1 - description1</a><br />
            </li>
            <li data-content="This item is new on Corkboard. Check it out!" data-original-title="New Item">
                <i class="icon-star"></i>
                <a href="newGenView.php?id=2">name2 - description2</a><br />
            </li>
        </ul>
    </body>
    </html>
    

    Also see this example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm generating a list from some string up to 4 NSUInteger total = MIN(4,
I'm generating List<int> x and List<int> y from List<Point> p using this code: List<int>
Are there any python packages that help generating SQL queries from variables and classes?
For one of my clients, I am generating a clients list from the Django
I am trying to select food_ItemName and food_UnitPrice from t_Food table in SQL Server
I am generating a list of check boxes, after parsing it from a JSON.
I am generating a list of flash SWFs, the information comes from an ajax
I am generating an SQL query: SELECT * FROM ToDoList WHERE ws_status <> 'Completed'
How do I generate a new list from random numbers that have the same
This is a frequently recurring problem of generating a tree from a flat list

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.