vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   vBadvanced CMPS - News Digest Module 1.02 (https://vborg.vbsupport.ru/showthread.php?t=70116)

Michael Morris 10-28-2004 08:35 AM

Hmm.. Try thread.replycount instead of just replycount

EDIT: That will work, though you'll need to make it alias to something else so that you can read the resultant variable.

Try thread.replycount AS comments

Then in the template the variable will be $news[comments]

EDIT2: To clarify the query will read as follows when you're done.

SELECT thread.threadid, thread.replycount AS comments, postusername, postuserid,

...and so on...

Jaxx 10-28-2004 08:48 AM

Yuppers. That work.

And i'm just about done with the other part now too. Just need to finish linking it somewhere. :)


Edit 1:

Ok, found the syndication needed to be turned on was the external javascript. I wasn't getting anythign with the xml on.

http://ahazi.org/index.php?page=pastnews <--- But link at bottom is not working and i'm not seeing the link you talked about showing up either in the forums.

Michael Morris 10-28-2004 09:23 AM

Oops, sorry.

We've got so many hacks running around on EN World it's hard to remember what the default features are..

The external javascript is kicked out by the hack in this thread

https://vborg.vbsupport.ru/showthread.php?t=59776

If you want to encourage people to syndicate your news I'd recommend it.

Michael Morris 11-01-2004 01:38 PM

Just when you think everything's fine the file goes haywire when the month wraps over. New version uploaded. This one doesn't rely on the MySQL Unix Timestamp function but instead uses strtotime(); to find the UNIX timestamp for the start of each of the last 8 days (including today).

WAR 11-01-2004 02:15 PM

Quote:

Originally Posted by Michael Morris
Just when you think everything's fine the file goes haywire when the month wraps over. New version uploaded. This one doesn't rely on the MySQL Unix Timestamp function but instead uses strtotime(); to find the UNIX timestamp for the start of each of the last 8 days (including today).

How difficult would it be to turn this into a weekly news digest?

I tried this:

PHP Code:

    $timespan strtotime('12:00 AM 2 weeks ago');
    
construct_newsdays(); 

And also changed the new query to:
PHP Code:

            WHERE thread.dateline>$timespan AND thread.forumid IN($vba_options[portal_news_forumid]) 
            AND 
thread.visible AND thread.open != 10 $notdeleted 

But it doesn't work it is still showing digests from yesterday and today (I installed it yesterday)
**It also seems to be showing them in the wrong order (yesterday's first followed by today's underneath***

I would like it to only display one digest at a time, updated daily, which includes all news posts from the last X number of days (instead of one digest a day displaying just items from that day) is that easily possible?

Michael Morris 11-01-2004 02:40 PM

Quote:

Originally Posted by WAR
I would like it to only display one digest at a time, updated daily, which includes all news posts from the last X number of days (instead of one digest a day displaying just items from that day) is that easily possible?

Not until I rework the code. What I need to do to figure out how to load all the posts in the specified timespan into a single array that the code can then manipulate. The flowchart would be

1. Get the range of days (possibly using $_REQUEST or $_POST so that users can look stuff up).

2. Use strtotime() to convert the range to Unix timestamps.

3. Run the query, putting the posts into an array sorted by time.

4. Divide the array up by days within the range.

5. Further divide by categories

6. Assemble it.

Doing it this way would save a LOT of queries.

Michael Morris 11-01-2004 02:42 PM

BTW, to be honest, this should be a default feature of vba_cmps IMO

Jaxx 11-01-2004 10:22 PM

Great Michael! It worked.

I just had to change my forum.icon to forum.fhbanner. That was different from the pervious version also. :)

WAR 11-17-2004 09:29 PM

Quote:

Originally Posted by Michael Morris
BTW, to be honest, this should be a default feature of vba_cmps IMO

Were you planning on reworking this? Or should I start trying to slog my way through it?

That isn't intended to sound demanding at all, merely inquisitive.

KTBleeding 11-17-2004 09:59 PM

Hmm. Is there an easy way to have it just display the title of the thread in the news forum and have that title link to the article?


All times are GMT. The time now is 07:01 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02095 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete