Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by TECK TECK is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 02-06-2002 Last Update: Never Installs: 0
 
No support by the author.

i want to understand why this code does not pull the information as demanded:

PHP Code:
copyrighted code (for now
i went with the logic. this code should grab the title and content from forum 1 and display only the last 3 threads. for some reasons, it will show ony the latest thread, not the 3 of them. can you tell me why? do i have to connect to the database with a mysql_connect and mysql_select_db?

the idea is to make a "what's new this week" side area where the script can pull the info from an invisible forum. i want to use also a comment script that will let anonymous users post what they think about the event. any help is appreciated. ty for taking the time to read this post.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-06-2002, 08:30 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Change this:
PHP Code:
  $getnewsql=$DB_site->query("SELECT * FROM post WHERE threadid='$newthreadid' ORDER BY postid ASC LIMIT 1");
  while (
$getnew=$DB_site->fetch_array($getnewsql)) {
    
$newpagetext=$getnew[pagetext];
    
$newpagetext=bbcodeparse($newpagetext);
    eval(
"\$newthisweek = \"".gettemplate('home_newthisweek')."\";");
  } 
to:
PHP Code:
  $getnewsql=$DB_site->query_first("SELECT * FROM post WHERE threadid='$newthreadid' ORDER BY postid ASC LIMIT 1");
  
$newpagetext=$getnew[pagetext];
  
$newpagetext=bbcodeparse($newpagetext);
  eval(
"\$newthisweek .= \"".gettemplate('home_newthisweek')."\";"); 
Reply With Quote
  #3  
Old 02-06-2002, 08:40 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ty firefly.. but if i do this it will not show anymore the content of the thread.. :?:

i think you know where i'm heading..... :supwink:
Reply With Quote
  #4  
Old 02-06-2002, 09:59 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$getnew=$DB_site->query_first("SELECT * FROM post WHERE threadid='$newthreadid' ORDER BY postid ASC LIMIT 1");
  
$newpagetext=$getnew[pagetext];
  
$newpagetext=bbcodeparse($newpagetext);
  eval(
"\$newthisweek .= \"".gettemplate('home_newthisweek')."\";"); 
Reply With Quote
  #5  
Old 02-06-2002, 11:11 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry Chen.. yesterday i was really tired. i did not see the query_first and "." change.

i tried this code:
PHP Code:
$getnewsql=$DB_site->query_first("SELECT * FROM post WHERE threadid='$newthreadid' ORDER BY postid ASC LIMIT 1");
  
$newtime=vbdate($timeformat,$new[dateline]);
  
$newdate=vbdate($dateformat,$new[dateline]);
  
$newpagetext=$new[pagetext];
  
$newpagetext=bbcodeparse($newpagetext); 
it's working great. once again you help people. how do you get the time to do all this?

i decided to remove the code for now. due to copy and paste reasons . with this script basically you will have the same news frontpage as vbulletin.org with a little twist, right Chen? . i will work now on the comments code and also maybe in a category module.. if Firefly is willing to help me a little..

i will see if Firefly accepts for me to release the code here to everyone... but since he never decided to publish his, i will respect his way of administrating this forum. also, i know that i'm not a good PHPer as many code writers here, but i love the challange.. so far PPN and Firefly were very helpfull and pointed me into the right direction with the code. i can only say one word: thanks.
Reply With Quote
  #6  
Old 02-07-2002, 11:40 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks.

I don't mind if you release the script, there are already several like this in the hacks forum. And besides, mine doesn't even work that way...
Reply With Quote
  #7  
Old 02-08-2002, 01:45 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok firefly . is it ok when i finish the code to email it to you? so you can take a look at it? i'm sure you will find some bugs. the credit will be also into it. (verified and aproved by Firefly) something like that....

i almost finished the comments.php code. i will not use any permissions on this script, so anonymous as well as registered users can post comments. the only difference will be that the anonymous user will have the IP published instead of hidden and will not be allowed to use VB code and smilies.

the comment box will be on the same page where the main news content and other's comments will be displayed. i will keep you all updated here with the progress of this project. i think alot of people will like it.
Reply With Quote
  #8  
Old 02-08-2002, 05:50 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can e-mail me with it if you want, but it could take me a bit to reply. Just letting you know.
Reply With Quote
  #9  
Old 02-08-2002, 10:31 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no prob chen. don't worry about it, i'm in no rush. as long as you can spare a little of your precious time, it's great for me. also, if there are any other hackers who are willing to help me to finalise this hack (i think is a nice idea all the options that i plan to implement), please post your answer in this thread. thanks.
Reply With Quote
  #10  
Old 02-11-2002, 12:04 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok firefly... i'm confused with the code present in root/forum/admin/forum.php:
PHP Code:
  if ($perms[canview]==1) {
    
$oldprivate=0;
  } else {
    
$oldprivate=1;
  } 
it referrs to the private forum, that you can set from admin panel.
how would i add a private news forum only for group 6 and 7 (journalists)?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:09 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.04821 seconds
  • Memory Usage 2,309KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete