vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   vbArticles v0.4 -- For your repository of Articles/Tutorials/FAQs etc. (https://vborg.vbsupport.ru/showthread.php?t=54331)

cinq 07-10-2003 04:05 AM

Quote:

07-04-03 at 06:41 AM 97cobracpe said this in Post #114
Your right, it should. But this hack was designed using the link directory hack as a model. With the other hack, there is no need to have auto formatting built into it as everything is one line big. Maybe in the future someone will do more with this hack, but until then this is the way it is. I personally don't mind it. I'd take a stab at it, but I'm no expert at php.
Yes and moreover, features were clearly stated on the very first post of what it CAN do. As well as planned features.
Thanks for the help 97cobracpe, if you manage to get the line break thing working, do drop me a pm to discuss , would sure appreciate it :)

cinq 07-10-2003 04:28 AM

Quote:

07-02-03 at 10:09 PM cnczone said this in Post #109
When someone fills out all the info (author, date, etc..) than I go to valadite it all the fields are filled with dates not the authors name or the title etc what gives???? Now when I', in the CP panel and correct it it's fine.
Does anyone face the same error ?

dontpanic 07-10-2003 05:45 PM

Quote:

07-05-03 at 07:29 PM kaotic said this in Post #115
I think I know someone that needs to count their blessings instead of bashing them. :rolleyes:
Right on. I think this a great hack. It's free and it's someone elses hard work. Why be a d1ck about it?

cing keep up the good work! :rambo:

Russ_T 07-10-2003 09:13 PM

cinq: just ignore them mate, the little whinney +++++es can go write their own mod and put it up if they are so much better.

If you could get the link going again sometime please I'd like to install and see as this is exactly what I need, and I'll add any productive comments/help I can.

Try to ignore the moaners though, these people are ++++ heads and theres not much you can do to stop them.

PurpleCow 07-11-2003 06:12 AM

cinq :

This sure is such a wonderful hack and great work from your end !

As few others mentioned above, just ignore those who stik their tongue out , just for the heck of it.

Hope the new version1.0 you are working on will be released soon.

Thank you for the hard work
Cheers

dontpanic 07-11-2003 04:40 PM

Excellent hack first of all!

Found and fixed two small errors in the vbArticlesadmin.php file.

Where you have:
PHP Code:

<a href='vbArticlesadmin.php?action=editarticle&catid=$catid&artid=[COLOR=red]$artid[/COLOR]'><b>Edit</b></a><br>
<
a href='vbArticlesadmin.php?action=removearticle&catid=$catid&artid=[COLOR=red]$artid[/COLOR]'><b>Remove</b></a></td>"; 

You need to change it to this:
PHP Code:

<a href='vbArticlesadmin.php?action=editarticle&catid=$catid&artid=[COLOR=red]$articleid[/COLOR]'><b>Edit</b></a><br>
<
a href='vbArticlesadmin.php?action=removearticle&catid=$catid&artid=[COLOR=red]$articleid[/COLOR]'><b>Remove</b></a></td>"; 

Thanks again cing for a great hack! Can't wait to see what you have in store for the next version! :D

dontpanic 07-11-2003 05:05 PM

cing, found another fix that makes it work all but perfectly now I think.

In the vbArticlesadmin.php file, locate:

PHP Code:

                $DB_site->query("UPDATE vbArticles_content SET valid='$val',title='".addslashes(htmlspecialchars($name[$key]))."',byline='".addslashes(htmlspecialchars($desc[$key]))."',author='".addslashes(htmlspecialchars($name[$key]))."',date='".addslashes(htmlspecialchars($name[$key]))."',content='".addslashes(htmlspecialchars($desc[$key]))."' WHERE artid='$key'");
          echo 
"<p>Validated Article: $key</p>\n"

And replace it with:
PHP Code:

                $DB_site->query("UPDATE vbArticles_content SET valid='$val',title='".addslashes(htmlspecialchars($title[$key]))."',byline='".addslashes(htmlspecialchars($byline[$key]))."',author='".addslashes(htmlspecialchars($name[$key]))."',date='".addslashes(htmlspecialchars($date[$key]))."',content='".addslashes(htmlspecialchars($desc[$key]))."' WHERE artid='$key'");
          echo 
"<p>Validated Article: $key</p>\n"

Also, locate:
PHP Code:

    makeinputcode("Title :","name[$link[artid]]",$link[title]);
    
maketextareacode("Description :","desc[$link[artid]]",$link[byline],4,50);
    
makeinputcode("Author :","name[$link[artid]]",$link[author]);
    
makeinputcode("Date :","name[$link[artid]]",$link[date]);
    
maketextareacode("Content :","desc[$link[artid]]",$link[content],10,50);
    
makeyesnocode("Validate:","validatelink[$link[artid]]",1);
    
makeyesnocode("Delete:","deletelink[$link[artid]]",0);
    
maketableheader("&nbsp;","",0);
    
$done=1

And replace it with:
PHP Code:

    makeinputcode("Title :","title[$link[artid]]",$link[title]);
    
maketextareacode("Description :","byline[$link[artid]]",$link[byline],4,50);
    
makeinputcode("Author :","name[$link[artid]]",$link[author]);
    
makeinputcode("Date :","date[$link[artid]]",$link[date]);
    
maketextareacode("Content :","desc[$link[artid]]",$link[content],10,50);
    
makeyesnocode("Validate:","validatelink[$link[artid]]",1);
    
makeyesnocode("Delete:","deletelink[$link[artid]]",0);
    
maketableheader("&nbsp;","",0);
    
$done=1

This should fix any errors that people had when trying to validate submissions from the AdminCP.

:banana:

iggy123 07-11-2003 09:18 PM

excellenmt - this works great now - just have to remember to format them properly LOL

dontpanic 07-11-2003 09:36 PM

OK, If you make the changes below you will be able to accept and validate HTML from the public submission page...of course you still need to get the material in HTML. :cool:

In articles.php, find:
PHP Code:

$result mysql_query("INSERT INTO vbArticles_content (categoryid, title, byline, author, date, content, valid) VALUES ('$catid', '".addslashes(htmlspecialchars($title))."', '".addslashes(htmlspecialchars($byline))."', '".addslashes(htmlspecialchars($author))."', '$date', '".addslashes(htmlspecialchars($content))."', $vd)"); 

Replace with:
PHP Code:

$result mysql_query("INSERT INTO vbArticles_content (categoryid, title, byline, author, date, content, valid) VALUES ('$catid', '".addslashes(htmlspecialchars($title))."', '".addslashes(htmlspecialchars($byline))."', '".addslashes(htmlspecialchars($author))."', '$date', '".addslashes($content)."', $vd)"); 

That fixes it so you can submit in HTML and maintain it while it goes into the database.

Now, in vbArticlesadmin.php, find in the DO VALIDATE NEW LINKS section:
PHP Code:

$DB_site->query("UPDATE vbArticles_content SET valid='$val',title='".addslashes(htmlspecialchars($name[$key]))."',byline='".addslashes(htmlspecialchars($desc[$key]))."',author='".addslashes(htmlspecialchars($name[$key]))."',date='".addslashes(htmlspecialchars($name[$key]))."',content='".addslashes(htmlspecialchars($desc[$key]))."' WHERE artid='$key'"); 

And replace it with:
PHP Code:

$DB_site->query("UPDATE vbArticles_content SET valid='$val',title='".addslashes(htmlspecialchars($title[$key]))."',byline='".addslashes(htmlspecialchars($byline[$key]))."',author='".addslashes(htmlspecialchars($name[$key]))."',date='".addslashes(htmlspecialchars($date[$key]))."',content='".addslashes($desc[$key])."' WHERE artid='$key'"); 

No guarantees this will work for you, but I've got it working now that users can submit articles properly formatted in HTML. I can then validate them and they will post formatted in HTML. :rambo:

cinq 07-12-2003 01:12 AM

Updated the hack with fixes from post 126 and 127.

Thanks a million, dontpanic for pointing them out and providing the fixes :)

As for post 128, without the change, your users cannot submit HTML content ?

dontpanic 07-12-2003 01:27 AM

Quote:

Today at 10:12 PM cinq said this in Post #130
Updated the hack with fixes from post 126 and 127.

Thanks a million, dontpanic for pointing them out and providing the fixes :)

As for post 128, without the change, your users cannot submit HTML content ?

You mean post 129?

Before that fix, you could submit HTML from the public page (articles.php?action=addarticle) all you wanted...you just lost the formatting when saved. That fix preserves HTML so that when you go to validate it later, its still good.

I have it all tweaked out and running like a champ right now at MCSE World. I am going to also be integrating an HTML editor into the submission page as well...unforunately that's a commerical product, so I won't be releasing that mod to your hack. :tired:

Thanks again!

cinq 07-12-2003 01:55 AM

Right, will throw that in as well , thanks for the clarification :D

HTML editor ? That sounds interesting, where can more info about it be found ? ( ie. purchased from ? )

You have integrated this hack into your infocenter really nicely.
Will put your site up as another live demo , hope you do not mind :)

cinq 07-12-2003 02:03 AM

Ok updated the hack download.

For those who installed it prior to 12-07-2003 ( today ) , please refer to posts 126, 127, 129 for fixes.

dontpanic 07-12-2003 02:03 AM

Thanks for all your hard work on this, I couldn't have gotten this far without!

As for adding the site as a live demo, please do...I'll never turn away more traffic. ;)

As for the HTML editor, I'm working with htmlEditbox 2.0. Haven't had the chance to start integrating it, but I'll let you know how it goes.

dontpanic 07-12-2003 02:05 AM

Sorry, just found this one. This affects editing categories from within the CP.

In vbArticlesadmin.php, find:
PHP Code:

// ############################# Edit Category #########################
if ($action=="editcat") {
$sql "SELECT * FROM vbArticles_cat WHERE artcatid=$artcatid"

Replace it with:
PHP Code:

// ############################# Edit Category #########################
if ($action=="editcat") {
$sql "SELECT * FROM vbArticles_cat WHERE artcatid=$catid"

I am really putting this hack through it's paces. Thanks again! :D

cinq 07-12-2003 02:06 AM

I was actually glancing through this hack here

Wonder if it can somehow be integrated.

cinq 07-12-2003 02:10 AM

And what does post 135 change ?

dontpanic 07-12-2003 02:22 AM

Quote:

Today at 11:10 PM cinq said this in Post #137
And what does post 135 change ?
Sorry, sometimes I forget to explain it all.

If you went to edit a category from within your AdminCP, you would get a fetch error. This corrects that. :)

As for that WYSIWYG editor...dunno, I didn't even see that when I looked earlier...but that's how it always is! If that can be integrated, and it's free, so much the better! :rambo:

Russ_T 07-12-2003 03:28 PM

cinq - Just to say thanks for giving me the hack and it installed fine.

One little change I made in index.php in /forum/admin I changed
Quote:

makenavselect("vbArticles","<br>");
for
Quote:

makenavselect("vbArticles");
as the gap was too big for me.

The edit page also says Byline and not Description :)

I get the error like others when editing and removing wont work for me either?

Quote:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/zclubnieW/forum/admin/vbArticlesadmin.php on line 234
A couple ideas that might have already been mentioned,

Is it possible to turn on full URL usage for the category image incase we don't want an image from the images folder?

Maybe an e-mail this article to a friend feature one day?

E-mail to the validater saying "New article to validate" with corresponding email option?

Thanks for the hack though, very good stuff, I like! If you would like me to help out or implement something for you just say.

Thanks again! :D I'm a happy bunny now, look at http://www.zclub.net/forum/articles....rticle&artid=2 :D

I'm now busy trying to chase down my vbArticlesadmin.php 234 error :D

Russ_T 07-12-2003 04:16 PM

Ok found it

in vbArticlesadmin.php

Quote:

$result = $DB_site->query("SELECT * FROM vbArticles_content WHERE Categoryid=$catid");
if ($myrow = $DB_site->num_rows($result)) {
while ($myrow=$DB_site->fetch_array($result)) {
$hasattach=1;
$articleid=$myrow["artid"];
should be

Quote:

$result = $DB_site->query("SELECT * FROM vbArticles_content WHERE Categoryid=$catid");
if ($myrow = $DB_site->num_rows($result)) {
while ($myrow=$DB_site->fetch_array($result)) {
$hasattach=1;
$artid=$myrow["artid"];
Last line changes as the $artid reference is used... not $articleid... :D

I haven't checked that fixes it but I'm sure it will.

Cheers

Russ_T 07-12-2003 05:16 PM

I found a new problem :)

When a user submits from the website and it needs to be validated everything goes fine until the admin validates, when this is done Title and Author get overwritten with the data from Date. I believe it's to do with the line

Quote:

$DB_site->query("UPDATE vbArticles_content SET valid='$val',title='".addslashes(htmlspecialchars( $name[$key]))."',byline='".addslashes(htmlspecialchars($desc[$key]))."',author='".addslashes(htmlspecialchars($name[$key]))."',date='".addslashes(htmlspecialchars($name[$key]))."',content='".addslashes(htmlspecialchars($des c[$key]))."' WHERE artid='$key'");
from line 190 vbArticlesAdmin.php where a lot of things have author=...$name, date=...$name, title=...$name. There seems to be a mix up with $name[$key] holding the date and being used in too many places.

I could be wrong as I haven't looked into it much.

Thanks

PurpleCow 07-13-2003 05:34 AM

I have a suggestion for the coming up version :

Right now the hack has an option of making the articles viewable only for registered members.

How about giving an option to admin....using which...individual permission can be given for viewable by registered members only.

What i mean, it should be possible to make certain articles viewable by all ( members/guests and other ), while certain articles will be viewable by only Registered members after logging in.

Within a category, few articles can be viewable by all, while others will be viewable by only registered members.
The articles which are viewable by only registered members will be marked with a small icon indicating the same.

Would u like to introduce this feature cinq ??

Thanks much

cleck673 07-13-2003 07:00 AM

Is there a way to intergrate this with vbportal where you can include a left column.

cleck673 07-13-2003 03:36 PM

Refering to the previous question, Does anyone else want to know how to? I am close to getting mine setup right. I figured, rather than being lazy - it is something I was, so I am trying to figure it out on my own. Thanks.

PixelFx 07-13-2003 09:34 PM

to add to this hack, would it be possible to make it so that articles are only viewable by style, and then by group?

dontpanic 07-17-2003 12:10 AM

Quote:

07-12-03 at 02:16 PM Russ_T said this in Post #141
I found a new problem :)

When a user submits from the website and it needs to be validated everything goes fine until the admin validates, when this is done Title and Author get overwritten with the data from Date. I believe it's to do with the line



from line 190 vbArticlesAdmin.php where a lot of things have author=...$name, date=...$name, title=...$name. There seems to be a mix up with $name[$key] holding the date and being used in too many places.

I could be wrong as I haven't looked into it much.

Thanks

Russ_T, make sure you perform the code fixes I posted in these locations:
https://vborg.vbsupport.ru/showthrea...989#post416989
https://vborg.vbsupport.ru/showthrea...000#post417000
https://vborg.vbsupport.ru/showthrea...031#post417031
https://vborg.vbsupport.ru/showthrea...093#post417093

I've gotten this hack tweaked out and running great with some additional custom mods of my own over at http://www.mcseworld.com/forums/infocenter.php

Best wishes! :smoke:

cnczone 07-17-2003 01:35 AM

Looks GREAT can you share!!??

dontpanic 07-17-2003 01:44 AM

Just make sure you download the updated version of the hack from the first page of this thread. Check the date...it should include all of the fixes identified in posts 126 and on...the only other thing I did was to integrate an HTML editor, but that's a commerical app. Lemme know if you have any other questions. :rambo:

morpheusXIIX 07-17-2003 05:22 AM

I did a very simple template edit to make it easier for registered users who no nothing about HTML. The mod tells the user how to use the br, p, i, b, and u tags.
Although you could easily modify the hack itself so that BB code would print out html. What I did was.

Open template vbArticles_addnewarticle
find:
PHP Code:

<smallfont>Full content of the article</smallfont

add below it:
PHP Code:

 <P>
<
smallfont>
- Use &
LT;br&GT; for line breaks<br>
- Use &
LT;p&GT; for double line breaks<br>
To make text boldencase it in &LT;b&GT;text&LT;/b&GT; <br>
To make text italicencase it in &LT;i&GT;text&LT;/i&GT; <br>
To make text underlinedencase it in &LT;u&GT;text&LT;/u&GT; <br>
</
smallfont

Do with it what you will.

Falkware 07-18-2003 04:34 PM

Firstly, thanks for a great hack! Working with this beta to hopefully fill a big void on our site. Thanks for taking the time to supply such a nice and needed addon for vbulletin!

Now, I've been keeping tabs with this thread, applying 'fixes' as they come in. I have all the nice updates provided by dontpanic. Thanks mate.

One problem that keeps persisting is the MySQL error on edit bug. Not been able to find a fix for it, and seems there's no fix to the very problem stated by more than me in this thread :)

The Infamous Error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /path/to/forums/admin/vbArticlesadmin.php on line 236

I get this error when I click "View all articles" then click "Edit" on and article in the list.

When I hope the link I notice it has "&artid=" at the end, but no representation of the article id.

I don't know if this is the problem, but if anyone can solve this MySQL error for me I'd be most grateful.

Thanks again for a great hack! Keep up the good work... (Here's the scary part... I got lots of ideas for this awesome system!! omg!) :bunny: :bunny: :bunny:

dontpanic 07-19-2003 09:01 PM

Falkware...

I think you just need to make the fix I posted here: https://vborg.vbsupport.ru/showthrea...989#post416989

Let me know if that fixes it or not.

:cool:

Falkware 07-21-2003 01:29 PM

Yeah I actually did install all your excellent fixes and it did solve some issues as reported in this thread. This one however is still lingering though, weird...

Thanks for replying :)

Asterik 07-21-2003 08:38 PM

Ok, i wanna download this hack but its not lettin me lol can someone send me it? Email: webmaster@plugspark.com AIM: MrPr0Grmer MSN: Graalian_Warrior@MSN.com Yahoo: panzerultima THX! i really need it :)

-God-iZ-iLLa- 07-22-2003 11:54 AM

i get this error when clicking "view/edit/add article"

Fatal error: Call to undefined function: maketableheaderview() in /home/eternale/public_html/forum/admin/vbArticlesadmin.php on line 11

Anything Im Missing here?

kaotic 07-22-2003 01:37 PM

Use dontpanic's fixes.

-God-iZ-iLLa- 07-22-2003 07:38 PM

i did still dont work...can anyone who has it working attach there vbArticlesadmin.php File so i can replace the current one?

cindyd 07-24-2003 09:05 PM

cinq-very nice hack! *Clicking install.

cindyd 07-24-2003 09:41 PM

When trying to access my regular forum I am getting this fatal error:

Quote:

Fatal error: Call to undefined function: adminlog() in /home/glassmav/public_html/forum/index.php on line 7
On line 7 is:

if ($action=="") {
adminlog(); -------> this is line 7
}

Can anyone help me out? My board is unaccessible right now. There wasn't a problem prior to this.

cinq 07-24-2003 11:35 PM

That's weird, because this hack doesnt amend anything in your forum index file at all.

Could it be another hack you just installed ?

cindyd 07-24-2003 11:42 PM

Everything was working fine until this install. They are telling me at Vbulletin to do this:

Reupload your original vB .php files. Make sure you upload them in ASCII and overwrite the ones on the server.

Good grief.


All times are GMT. The time now is 08:09 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.02218 seconds
  • Memory Usage 1,924KB
  • 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
  • (14)bbcode_php_printable
  • (13)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
  • (40)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