vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Import Unread News from a Forum (https://vborg.vbsupport.ru/showthread.php?t=115179)

antialiasis 05-10-2006 11:13 AM

This must be some sort of clash with another product. Do you already have something installed that could have a setting called "newsforum"?

reteep 05-10-2006 11:36 AM

Cool idea but doesn't work here:

Quote:

Invalid SQL:

INSERT INTO vb3_setting
(varname, grouptitle, value, defaultvalue, datatype, optioncode, displayorder, advanced, volatile, product)
VALUES
(
'importnews',
'newsimporting',
'',
'',
'boolean',
'yesno',
1,
0,
1,
'import_news'
),
(
'newsforum',
'newsimporting',
'86',
'1',
'numeric',
'',
2,
0,
1,
'import_news'
);

MySQL-Fehler : Duplicate entry 'newsforum' for key 1
Fehler-Nr. : 1062
Datum : Wednesday, May 10th 2006 @ 02:33:14 PM
Skript : /vb/admincp/plugin.php
Referrer : /vb/admincp/plugin.php?do=productadd


Klassenname : vB_Database
vbAdvanced is using that name, you should use another table name!

antialiasis 05-10-2006 11:59 AM

Ah, okay, had to be something like that. The product has been updated to use 'importnewsforum' instead.

EDIT: One more fix... and a note of the updates in the first post.

I think I'll make a version 2.0 soon where the functionality that FleaBag requested will be automatically in and controllable through the Admin CP...

rmxs 05-10-2006 04:21 PM

Database error in vBulletin 3.5.4:

Invalid SQL:

SELECT threadid
FROM +++++ad
WHERE userid = 450 AND threadid IN ();

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3
Error Number : 1064
Date : Wednesday, May 10th 2006 @ 11:22:45 AM
Script : http://www.*****r/**/showthread.php?t=1174
Referrer : http://www.****r/**/forumdisplay.php?f=26
IP Address : 1****
Username : ***
Classname : ****


Onother error here??there is fix??

TomasDR 05-10-2006 05:03 PM

rmxs your answer is in the first bug I found.

First bug: I had to add " . TABLE_PREFIX . " to your two select statements.
Code:

$newsthreads = $db->query_read("
  SELECT threadid, title, dateline
  FROM " . TABLE_PREFIX . "thread
  WHERE forumid = $newsforum
  $queryaddition
  ORDER BY dateline DESC
");

$readnews = $db->query_read("
  SELECT threadid
  FROM " . TABLE_PREFIX . "+++++ad
  WHERE userid = " . $vbulletin->userinfo['userid'] . " AND threadid IN (" . implode(',', $newsids) . ")
");

As for another bug, for the life of me I cannot figure out how you are displaying the news on the forumhome without adding a variable to the either the Header template or even the Navbar template.

I tried the variables $newsitems & $unreadnews without success, the $newsitems variable works but it isn't defined in a nice colored box like in your screenshot. It just puts the latest news right above the navbar but again not formatted to a template.

antialiasis 05-10-2006 05:32 PM

Oh, crap... more screw-ups...

What you're supposed to do is add $unreadnews to the bottom of the header template. It sounds odd that $unreadnews wouldn't be working, though. (You were testing it as logged in, right? And enabled the hack in the Admin CP, specified a news forum and all that?)

rmxs 05-10-2006 05:38 PM

If i set news forum to 0 its OK :)

If i set forum news to exaple 1 i get this error line Fatal error: Call to undefined function: array_combine() in /home/rmxs/domains/rmxs.gr/public_html/Vb/global.php(349) : eval()'d code on line 301

antialiasis 05-10-2006 05:47 PM

Ah, you must be using PHP 4 or earlier, then. array_combine() was apparently introduced in PHP 5...

A workaround for that should be fairly simple... find the line

Code:

  $newsarray = array_combine($newsids, $newsinfo);
in the Import News plugin on global_start, and replace it with

Code:

  $newsarray = array();
  for ($i = 0; i < count($newsids); i++)
  {
      $newsarray["$newsids[$i]"] = $newsinfo[$i];
  }

That should work basically the same as that built-in function.

rmxs 05-10-2006 05:53 PM

Ok now it works with no error byt im not get any message on the header and im lose the global attachment Block

im use PHP Version 4.4.2

antialiasis 05-10-2006 06:07 PM

Quote:

Originally Posted by rmxs
Ok now it works with no error byt im not get any message on the header and im lose the global attachment Block

im use PHP Version 4.4.2

You won't get a message unless you actually have unread news. That's how it's supposed to work.

What do you mean, you lost the global attachment block?


All times are GMT. The time now is 08:12 PM.

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.01455 seconds
  • Memory Usage 1,741KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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