vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   [cinq's vbArticles v1.0 Hack] - The development process (https://vborg.vbsupport.ru/showthread.php?t=69906)

rake 01-05-2005 03:21 PM

ooops... ORDER BY articles_articleid

j_86 01-05-2005 04:58 PM

I'm soooo looking forward to this!

I have this feature list to suggest;

1) List of article contributers (and auto link to their profile on the forum, if it exists)
2) List of "sources" of information borrowed from someonewhere else for purposes of the article
3) A ModCP panel to admin articles
4) An "edit log" shown on the side of the article front end; edits to the article can be optionaly given a reason for editing by the user, maybe with some predefined reasons such as "Language Error"

cinq 01-06-2005 01:57 AM

Problem 2 solved ! ( thanks Rake ! )

Code used :
PHP Code:

 # previous and next article links
    
if($nextone $DB_site->query_first("SELECT articles_articleid FROM " TABLE_PREFIX "articles_article WHERE articles_articleid > $artid AND categoryid = $categoryid ORDER BY articles_articleid ASC LIMIT 1"))
    {
        
$nextone $nextone['articles_articleid'];
        
$nextarticle 1;
    }

    if(
$previousone $DB_site->query_first("SELECT articles_articleid FROM " TABLE_PREFIX "articles_article WHERE articles_articleid < $artid AND categoryid = $categoryid ORDER BY articles_articleid DESC LIMIT 1"))
    {
        
$previousone $previousone['articles_articleid'];
        
$prearticle 1;
    } 

Decided to put in
PHP Code:

AND categoryid $categoryid 

to limit to previous or next articles in the same category.

cinq 01-06-2005 02:08 AM

Quote:

Originally Posted by JimpsEd
I'm soooo looking forward to this!

I have this feature list to suggest;

1) List of article contributers (and auto link to their profile on the forum, if it exists)
2) List of "sources" of information borrowed from someonewhere else for purposes of the article
3) A ModCP panel to admin articles
4) An "edit log" shown on the side of the article front end; edits to the article can be optionaly given a reason for editing by the user, maybe with some predefined reasons such as "Language Error"

1) Yes, will be implemented. Currently, this is set up such that there is an author field, and there is a Posted by field ( as typically they can be 2 different persons or the author may not be a forum member ).

2) Already implemented, with a references/sources delimiting option in Admincp options to seperate each reference/source. Will only show at base of article if there are any. :)

3) I will stick to admincp first, but eventually may consider modcp as well.

4) Already implemented, also shows the date of the amendment. Amendment notes only appear in the backend when editting an article, no point having it when adding one. Also date of amendment is provided by time(), no need for user input. :)

oly51 01-06-2005 09:50 AM

This is turning into exactly what I have been looking for. :classic:

Will it be possible to place an image thumbnail in the article next to its related text? Click on it for full view.

j_86 01-06-2005 02:04 PM

This is incredible c1nq good job :)

cinq 01-07-2005 03:31 AM

Quote:

Originally Posted by oly51
This is turning into exactly what I have been looking for. :classic:

Will it be possible to place an image thumbnail in the article next to its related text? Click on it for full view.

I am not totally understanding this.
Currently there is an article preview icon/image, with a link to the article proper.

cinq 01-07-2005 09:48 AM

Here's another to ponder on .

Problem Number 3

PHP Code:

# Categories and subcategories column
$parentcatquery $DB_site->query("SELECT * FROM " TABLE_PREFIX "articles_category WHERE parentcategory=0 ORDER BY categoryorder");
if (
$DB_site->num_rows($parentcatquery)>0)
{
    while(
$parentcatrow=$DB_site->fetch_array($parentcatquery))
    {
        
$parentid $parentcatrow["articles_categoryid"];
        
$catname $parentcatrow["categoryname"];
        
$parentcat $parentcatrow["parentcategory"];

        eval(
'$catlistbit .= "' fetch_template('vbArticles_categorybit') . '";');
        eval(
'$catlistbit .= "' fetch_template('vbArticles_categorybit_pre') . '";');

           
$subcatquery $DB_site->query("SELECT * FROM " TABLE_PREFIX "articles_category WHERE parentcategory = $parentid ORDER BY categoryorder");
        if (
$DB_site->num_rows($subcatquery)>0)
        {
            while(
$subcatrow=$DB_site->fetch_array($subcatquery))
            {
            
$subcatid=$subcatrow["articles_categoryid"];
            
$subcatname=$subcatrow["categoryname"];
            eval(
'$catlistbit .= "' fetch_template('vbArticles_childcatbit') . '";');
            }
        }
    eval(
'$catlistbit .= "' fetch_template('vbArticles_categorybit_post') . '";');
    }


I am trying to get the categories and then the subcategories of the parent category.
Is there anyway I can change things around to optimize what I am trying to do ?

As it is, this is probably the code portion contributing to the massive amount of queries ( testing : 32 queries at this time, with 4 parent cats, each with 5,4,1,6 subcats respectively )

oly51 01-07-2005 09:56 AM

Quote:

Originally Posted by cinq
I am not totally understanding this.
Currently there is an article preview icon/image, with a link to the article proper.

Right. I was referring to a thumbnail in the article proper. Say someone was writing a 'how-To' article. In the article, they put a text paragraph and in the next paragraph, they put a thumbnail that shows what the text in that paragraph is describing. The thumb would be on the left (or right) and the text would go to the side and under the thumb.

Sorry for not being clear.

nathanaus 01-07-2005 10:10 AM

Maybe this isn't really appropriate (I'm new forgive me) but what would be nice to see in it:

1. Ability to give reputation points to an article author.

2. There is a hack here to gie award to posts, could something similar be done that if an article is well written there is an option for the admin to give an "award" with associated image that sticks to the article indicating that it won an award for "good article writing" or soemthing?


All times are GMT. The time now is 11:59 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.01587 seconds
  • Memory Usage 1,766KB
  • 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_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