vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   [RELEASE] Save Threads Version 1.0 (https://vborg.vbsupport.ru/showthread.php?t=3596)

10-10-2000 02:33 PM

Quote:

Originally posted by rangersfan
in the third post in this thread I brought up the potential for this sort of behavior to occur :)

I read it, and try it, because you post that.

Sometimes you just don't want to release hacks because of the negativity that can be directed towards you.
If you write that because me, im sorry, the problem was we can understand us (TWT and me). Apologies to TWT if he feels its the case and for my bad english again.

Maybe this help:

I thing the best way to make the limit of # saved thread is:

Set one variable for that in the script:

IF #savedthreads = #maxsavedthreads
THEN
Show message "You have the limit of tread... delete some... and then add more..."
ELSE
Add new savedthread.

I dont know php or mysql, but i thing this is the quiz. Then the webmaster can set #maxsavedthreads.

Thanks again.

10-10-2000 03:16 PM

Hi fenix,

Absolutely - that would definetly work...and I think I'll add it to the next version...my main goal though, has been to split a high number of saved threads over to a new page...IE...page 1 has saved threads 1-10, page 2 has 11-20, etc.

I tried searching on PHP.net and PHPBuilder.com but just couldn't get the hang of it. :(

10-10-2000 04:03 PM

Use MySQL's LIMIT feature:
LIMIT 0,10 <-- will get 10 records, starting from the first one (0)
LIMIT 10,20 <-- will get 20 records, starting from the 11th

just add something like:

if (!$limitstart) {
$limitstart = 0;
}

$limitquery = "LIMIT $limitstart,25";

And reference $limitquery in your MySQL query.

Showing the paging mechanisms involves counting how many threads there actually are, then running a loop. Here's the code I used in mArticle to do it:
Code:

        $acount=$DB_site->query_first("SELECT COUNT(id) AS id FROM $table[articlemain] WHERE section=$sec AND (notes NOT LIKE '%U%')");
        $count=$acount[id];
        $amntpages = ceil($count/$maxperpage);
        if ($amntpages==0) { $amntpages = 1; }
        $i = 0;
        $pages = "";
        while($i<$amntpages) {
                $i2 = $i + 1;
                $limit = $maxperpage * $i;
                if ($limit==$limitstart) {
                        eval("\$pages .= \"".usetemplate("browsesec_pagecur")."\";");
                } else {
                        eval("\$pages .= \"".usetemplate("browsesec_pageother")."\";");
                }
                $i++;
        } //end while $i<=$amntpages

Obviously, you'll have to change the variable names and change the references to "usetemplate"

10-22-2000 05:04 AM

Commish : I am working on my own thread saving hack at the moment. It is going to have pages (of course) and have a folder system where you can categorize your threads. It will also allow for you to sort the list via a few different criteria.

Here is my monster SQL statement at the moment (all I really have right now)

Code:

$q = $DB_site->query("SELECT title, favorites.userid, favorites.threadid, folder                   
                      FROM favorites,thread
                      LEFT JOIN favorites_folders ON (favorites.folderid = favorites_folders.folderid)
                      WHERE favorites.userid = $bbuserid AND thread.threadid = favorites.threadid
                      ORDER by folder,title");


10-22-2000 05:12 AM

In that case I'll probably dispose of mine - was fun while it lasted. :) Glad to turn it over to someone with more experience.

Good luck.

10-22-2000 08:55 PM

Here is my updated query:

Code:

  $q_thread = $DB_site->query("SELECT thread.iconid, icon.title AS icontitle, icon.iconpath, open, thread.title AS threadtitle, 
                        lastpost, postusername,lastposter, views, replycount, fav_threads.userid, fav_threads.threadid,
                        fav_threads.folderid, folder
                        FROM fav_threads,thread
                        LEFT JOIN fav_folders ON (fav_threads.folderid = fav_folders.folderid)
                        LEFT JOIN icon ON (icon.iconid = thread.iconid)
                        WHERE fav_threads.userid = 1 AND thread.threadid = fav_threads.threadid
                        ORDER by folder,thread.title");

I have come up with an optimization for forumdisplay. Did you know that vB runs a query for each thread shown on forumdisplay to retrieve the Name and Path to the message icon (if the thread has one). Using a simple LEFT JOIN you can get that info with the query that retrieves all the threads to begin with. I have incorporated it into my favorites hack.

10-24-2000 12:24 AM

Please refer to thread http://www.vbulletin.com/forum/showt...7193#post37193 for the beta release of my hack. Will update this thread when I declare it final.


All times are GMT. The time now is 11:11 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.01238 seconds
  • Memory Usage 1,738KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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