Results 1 to 6 of 6

Thread: Block between 1st and 2nd News Blocks?

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    8

    Default Block between 1st and 2nd News Blocks?

    I was hoping to stuff an add block between the 1st and second news blocks on the main page, much like the hack to add a section between the first and second postbit. I looked at it and it seems that the post bit works as the template is called over and over as long as there is posts. There you can test for the post number and stuff the ad if its called for. In the news block its just a variable in the template with the actual building taking place in news.php. I looked at that file and found the loop that calls the news forum database location untill the max news count is set. I figure here would be the place to insert the ad code. Also here is where my coding skills end.

    Could I add a new $getnews in an if statment in the loop that tests for the loop count right after the database query for the same variable?

    Basically the add would become part of the first news bit that was queried.

    Maybe something like...(Added right before the while loop that contains "$newscount++;"

    Code:
    if ($newscount == 0){$getnews = 'Add code or text here';}
    Would this push the data I want onto the stack?

    Let me know if I'm on track or not.

    Thanks!

  2. #2
    Junior Member
    Join Date
    Oct 2005
    Posts
    8

    Default Re: Block between 1st and 2nd News Blocks?

    Well I didnt have much luck with that effort.


    I'm down to now adding the code into the data base and calling that if the newscount is set to 0.

    Maybe I can do it within the query ($getnews = $db->query_read).

    I'll mess with it some more. I would really like to stick some ads there.

  3. #3
    Junior Member
    Join Date
    Oct 2005
    Posts
    8

    Default Re: Block between 1st and 2nd News Blocks?

    Made some headway. I can now add text to the first news article and that one only by adding text to "pagetext" using (The dots are added):

    Code:
    if ($newscount == 0){$news['pagetext'] = $news['pagetext']."..";}
    The problem is that is treats it as strait text. It does not look like I could add a table. But maybe I could if I allow html....

    Hmmmm....

  4. #4
    Junior Member
    Join Date
    Oct 2005
    Posts
    8

    Default Re: Block between 1st and 2nd News Blocks?

    Well BB code works when its added. I can space down or add links and stuff, or an image. So I could add a static banner but I need the script tags to work so I can add the google adds.

    Getting there.

  5. #5
    Administrator Brian's Avatar
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,434

    Default Re: Block between 1st and 2nd News Blocks?

    Just edit your adv_portal_newsbits template and add an if condtion that looks something like this at the end:

    <if condition="$newscount == 1">

    Ad code here

    </if>

  6. #6
    Junior Member
    Join Date
    Oct 2005
    Posts
    8

    Default Re: Block between 1st and 2nd News Blocks?

    I should have thought of testing for it in the template. Duh.

    It worked perfect. Thanks Brian!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. News Block Issue
    By offline in forum Troubleshooting / "How do I..." Questions
    Replies: 3
    Last Post: 05-14-2005, 11:32 AM
  2. Avatar in news block.
    By bigcurt in forum Troubleshooting / "How do I..." Questions
    Replies: 6
    Last Post: 02-26-2005, 01:00 AM
  3. news block - doesnt show up
    By tercede in forum Troubleshooting / "How do I..." Questions
    Replies: 2
    Last Post: 02-13-2005, 03:35 AM

Posting Permissions

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