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 ?


All times are GMT. The time now is 03: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.01634 seconds
  • Memory Usage 1,809KB
  • 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
  • (10)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
  • (2)pagenav_pagelinkrel
  • (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