Results 1 to 5 of 5

Thread: Show all Entries for a Specific Year

  1. #1

    Question Show all Entries for a Specific Year

    I am using a vba-dynamics instance for news articles and I would like to put in links to go in the calendar module (perhaps just below the calendar) - to show all the news articles (entries) published in each of 2012 and 2011.

    something like:
    <a href ="url-for-all-2012-entries">News for 2012</a>
    <a href="url-for-all-2011-entries">News for 2011</a>

    I presume this code would have to go in the template: adv_dyna_module_calendar_wrapper


    Is there a way I can show what news articles were published for a whole specified year? Could this be done using a search via URL (hyperlink) or some other search query code, if so what would the code / URL be that I need to put in the template?


    Thank you for your help in advance.


    tfm (posting from aam's account)

  2. #2
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default

    This might be possible by altering the search feature a bit, but unfortunately I don't think there are any links that can be generated to search for entries from a specific year.
    Frequently Asked Questions
    CMPS Users Manual

    For vBadvanced software assistance, please use the support forums.
    Unsolicted PMs, IMs, and email will not be responded to.
    If you have a non-software related question or problem with your account, please submit a support ticket.

  3. #3

    Lightbulb More thoughts on Searching and Displaying Entries for a Specific Year

    Quote Originally Posted by aam View Post
    I am using a vba-dynamics instance for news articles and I would like to put in links to go in the calendar module (perhaps just below the calendar) - to show all the news articles (entries) published in each of 2012 and 2011. ... Is there a way I can show what news articles were published for a whole specified year? Could this be done using a search via URL (hyperlink) or some other search query code, if so what would the code / URL be that I need to put in the template?
    Quote Originally Posted by Brian View Post
    This might be possible by altering the search feature a bit, but unfortunately I don't think there are any links that can be generated to search for entries from a specific year.

    I have had some thoughts on how to do this to some extent and I have a few more related questions. If I create a new custom field for the 'News Year' (field5), which is a select menu drop down box, with options like: '2011', '2012' and '2013', I found that I can put in a custom search URL on the template page for the module, that I want it to go in, as follows:

    <a href="url-to-vbaDynamics-instance/search.php?do=searchresults&catids[]=0&cfields[]=field5&string=2012">2012 News</a>

    Clicking on the resulting link seems to give me a list of all entries in 2012 going from the oldest to the latest date. However I have a few issues with this.


    1. If I want to reverse the order so the latest entry is at the top of the search results page, how do I do this?


    2. Also if I click on the link as a guest it doesn’t work and I see the following message: "The string you entered for the image verification did not match what was displayed". (I have image verification turned on for guests in vbulletin as a whole, for searches, and in this case I don't see the image verification box come up so the search does not work. Is there something I can do to get this search to work for guests?


    3. Another big issue, with the method I describe above, is that you end up putting in exactly the same information twice in two different fields for each entry
    - as the year given for my publication date of the entry
    - is the exact same thing as the year entered in my custom field for News Year (field5).

    I've seen the following in the ADV_DYNA_ADD_EDIT template,
    <select name="customdate[year]" tabindex="1">{vb:raw datelinesel.years}</select>
    which seems to be collecting the same information in an existing field as my custom field for News Year would be collecting.

    So I wondered, is there a way I can just use the year for the date of the entry instead of adding a new field for what is exactly the same information?



    Thank you for your help in advance.

    tfm (posting from aam's account)

  4. #4
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default

    Actually, you may be able to do this easily enough with a plugin. Try adding a new plugin to the 'vba_dyna_browsecategory_default' hook location with the following code, then you should be able to add "&year=X" to the end of a URL to make things work.
    PHP Code:
    if ($_REQUEST['year'])
    {
        
    $year intval($_REQUEST['year']);
        
        
    $eventdate gmmktime(00011$year);
        
    $enddate gmmktime(0001231$year);

        
    $datedisplay $year;

        
    $datequery 'entries.dateline >= ' $eventdate ' AND entries.dateline <= ' $enddate;

    Frequently Asked Questions
    CMPS Users Manual

    For vBadvanced software assistance, please use the support forums.
    Unsolicted PMs, IMs, and email will not be responded to.
    If you have a non-software related question or problem with your account, please submit a support ticket.

  5. #5

    Default

    Quote Originally Posted by Brian View Post
    Actually, you may be able to do this easily enough with a plugin. Try adding a new plugin to the 'vba_dyna_browsecategory_default' hook location with the following code, then you should be able to add "&year=X" to the end of a URL to make things work...
    Hi Brian,
    Thank you for your suggestion on a simpler method to get things to work to show entries per year (compared to my - add a new field for the year method).

    I made the plugin you suggested but when I put in the following URL,
    url-to-vbaDynamics-instance/search.php?do=searchresults&catids[]=0&year=2012
    into the browser bar I found this didn't work and I saw the following message (provided I was logged in),
    Please specify some words or valid user names to search on. There were no matches for those that you specified.
    I also tried:
    url-to-vbaDynamics-instance/search.php?do=searchresults&year=2012
    this also gave the exact same message as above.

    So I wondered if I might be structuring the URL wrong. Would this be the case? If so please could you tell me where I am going wrong?

    Thank you.

    tfm (posting from aam's account)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. show entries under catagories
    By AndrewSimm in forum "How Do I..." Questions
    Replies: 2
    Last Post: 08-11-2012, 12:06 PM
  2. show only entries with a certain field
    By AndrewSimm in forum "How Do I..." Questions
    Replies: 0
    Last Post: 01-27-2012, 06:30 PM
  3. Show Vbuleltin Blogs Featured Entries
    By Dunhamzzz in forum Module & Modification Discussion & Requests
    Replies: 3
    Last Post: 08-08-2009, 10:33 AM
  4. Show custom fields in entries?
    By BWJ in forum "How Do I..." Questions
    Replies: 4
    Last Post: 09-13-2007, 07:01 AM
  5. Can I just show recent entries on a hompage with this?
    By pjhawksr in forum "How Do I..." Questions
    Replies: 1
    Last Post: 10-24-2005, 12:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •