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)

cinq 01-10-2005 01:07 PM

Just an update, optimized several queries with some help here

Working on a report comment, edit comment, delete comment feature now.
Once done, will download FCK and give it a go.

I think I will then wrap things up with an installation script ( 40+ templates, many settings and phrases to create, plus 4 db tables creation ) , if FCK goes smoothly .... unlike spaw ...

Torqued 01-10-2005 01:25 PM

woo hoo! can't wait to see this hack! :)

sabret00the 01-10-2005 03:43 PM

Quote:

Originally Posted by cinq
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.

you can do that in one query.

sabret00the 01-10-2005 03:48 PM

Quote:

Originally Posted by nexialys
1- pagination is a 3 lines code... already have something inside vB for that.

wow, it is, i haven't ever rewritten the code i was giving along time ago for sorting pagenav but the code i have is 30 lines long :shock:

please share the knowledge :o

cinq 01-11-2005 12:08 AM

Quote:

Originally Posted by sabret00the
you can do that in one query.

Would be nice if you could share how to ?

cinq 01-11-2005 07:09 AM

report comment, edit and delete comment done.
FCK's basic WSYIWYG integration works too, now working on the image upload handling in FCK. :D

sabret00the 01-11-2005 08:01 AM

something like this

PHP Code:

    if ($nextone)
    { 
// set the variables
            
$nextone $nextone['articles_articleid'];
            
$nextarticle 1;
        
$articlenav_direction ">";
        
$articlenav_order "ORDER BY articles_articleid ASC";
    }
    else if (
$previousone)
    {
        
$previousone $previousone['articles_articleid'];
        
$prearticle 1;
        
$articlenav_direction "<";
        
$articlenav_order "ORDER BY articles_articleid DECS";
    }

    
$articlenav $DB_site->query_first("SELECT articles_articleid FROM " TABLE_PREFIX "articles_article WHERE articles_articleid $articlenav_direction $artid AND categoryid = $categoryid $articlenav_order LIMIT 1"); 

far from impressive really, both acheive the same thing as well, theris really no reason to switch since it don't perform the query unless asked to.

cinq 01-11-2005 08:10 AM

I don't think your code does what I need it to do.
I need to query 2 times first to know if there are next or previous articles available.

In your code, if($nextone) or if($previousone) has no value initially...

cinq 01-11-2005 09:43 AM

Hmm FCK's default resource browser is really confusing. I have stripped away code to simplify it but not exactly giving the full functionality I would hope for.

ie. when adding an article, a folder for that article for its images is automagically created and when browsing should be only able to see this created folder.
However it now sees all folders. There is no way to pass the folder path to FCK to tell it to dynamically only show that particular folder.

It just means that you will have to manually search for the folder ( i will provide an folder number for you to search for ), click on it, to show all the images, or upload images there as well.

If this sounds about good, I consider this hack done and I will move on to the installation script. Please let me know.

sabret00the 01-11-2005 11:28 AM

Quote:

Originally Posted by cinq
I don't think your code does what I need it to do.
I need to query 2 times first to know if there are next or previous articles available.

In your code, if($nextone) or if($previousone) has no value initially...

the determination of the preview or next article before hand is impossible via my way you're right i apologise, however the $next and $preview comes from the url

i.e.
HTML Code:

<a href="http://localhost/forums/article.php?a=104845&nextone">next one</a>
the code would work but not for what you need it for without getting creative in the most awesome ways imaginable :lol: joking.


All times are GMT. The time now is 08:43 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.01231 seconds
  • Memory Usage 1,758KB
  • 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
  • (1)bbcode_html_printable
  • (3)bbcode_php_printable
  • (4)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