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

Reply
 
Thread Tools
vBJournal Lite enhancements Details »»
vBJournal Lite enhancements
Version: , by sabret00the sabret00the is offline
Developer Last Online: Apr 2010 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 11-26-2003 Last Update: Never Installs: 0
 
No support by the author.

PHP Code:
// display 3 entries per users on most recent entries panel
$j_limit e.userid u.userid AND e.userid j.userid LIMIT 3
 
$journal_recent_entries 
$DB_site->query("SELECT j.enabled, u.username, e.journalid, e.title, e.entry, e.timestamp, e.userid 
                                FROM journal_entry e, journal j, user u 
        WHERE 
$j_limit 
        AND e.private = 0 AND j.enabled = 1 
                                ORDER BY e.timestamp DESC 
        LIMIT 23"
); 
PHP Code:
// find comments per journal entry for most recent entries panel
 
$j_comments $DB_site->query_first("SELECT COUNT(commentid) FROM journal_comments where journalid = $journalid AND WHERE e.entry = e.title");
 
jl_comments = if($j_comments 1){
         echo(
"$j_comments comment")
} else if(
$j_comments >= 2) {
echo(
"$j_comments comments") {
else{
echo(
"")
}; 
could you please help me to get this to work and tell me where i've gone wrong on my train of thought please

Show Your Support

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

Comments
  #2  
Old 11-26-2003, 03:55 PM
gmarik's Avatar
gmarik gmarik is offline
 
Join Date: May 2002
Location: Mocsow
Posts: 1,288
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And what exaclty do you need?
Have you seen KuraFire's hack?
Reply With Quote
  #3  
Old 11-26-2003, 03:57 PM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try replacing:
PHP Code:
[color=red][color=#000000]$ jl_comments = if($j_comments = 1){
         
echo("$j_comments comment")
} else if(
$j_comments >= 2) {
echo(
"$j_comments comments") {
else{
echo(
"")
};[/
color]
[/
color
with

PHP Code:
$jl_comments = if($j_comments 1)
{
     echo(
"$j_comments comment");
}
else if(
$j_comments >=2)
{
     echo(
"$j_comments comments");
}
else
{
     echo(
"");
}; 
Also, I dont think you can use an if statement when declaring a variable but im not sure.
Reply With Quote
  #4  
Old 11-26-2003, 03:59 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by gmarik
And what exaclty do you need?
Have you seen KuraFire's hack?
yup but Kura's hack is vb3 and from what i've seen the vb2 features aint really what i'm after, but this is just two quick edits to my existing journal lite set up, i want to limit the most recent entries to show a maximum of 3 entries per user and then after that i wanna show how many comments an entry has on in the most recent entries column

as you can see here www.ebslive.com/forums/journal.php some people get hyperactive about updating which is upto them but i don't want it inflicted on the rest of the users.
Reply With Quote
  #5  
Old 11-26-2003, 04:03 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by assassingod
Try replacing:
PHP Code:
jl_comments = if($j_comments 1){
         echo(
"$j_comments comment")
} else if(
$j_comments >= 2) {
echo(
"$j_comments comments") {
else{
echo(
"")
}; 
with

PHP Code:
$jl_comments = if($j_comments 1)
{
     echo(
"$j_comments comment");
}
else if(
$j_comments >=2)
{
     echo(
"$j_comments comments");
}
else
{
     echo(
"");
}; 
Also, I dont think you can use an if statement when declaring a variable but im not sure.
i thought the conditional was fine, i was more worried about the initial SELECT
Reply With Quote
  #6  
Old 11-26-2003, 04:05 PM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You had missed out some ; and used an { instead of a }

I can't see a problem with the SELECT but I don't know the table structure so I can't confirm
Reply With Quote
  #7  
Old 11-26-2003, 04:10 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh thanks didn't see that

i guess, i'll only know if i test the second one then

but what about the first one the
PHP Code:
// display 3 entries per users on most recent entries panel
$j_limit e.userid u.userid AND e.userid j.userid LIMIT 3
 
$journal_recent_entries 
$DB_site->query("SELECT j.enabled, u.username, e.journalid, e.title, e.entry, e.timestamp, e.userid 
                                FROM journal_entry e, journal j, user u 
        WHERE 
$j_limit 
        AND e.private = 0 AND j.enabled = 1 
                                ORDER BY e.timestamp DESC 
        LIMIT 23"
); 
Reply With Quote
  #8  
Old 11-26-2003, 04:15 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Also, I dont think you can use an if statement when declaring a variable but im not sure.
You can, but certainly not in that syntax with the assignment behind the IF.

Example of proper usage:
PHP Code:
if($array $DB_site -> query_first())
{

As for your script Sabret, your syntax is mostly made up. Try looking at some vB scripts in the queries, as you need to use LEFT JOINs, etc. Always incase your strings in quotes, and use proper tabulation!
Reply With Quote
  #9  
Old 11-26-2003, 04:49 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

see i was thinking left joins as i learned that the other day, but as the rest of the script is written in such a fashion and i'm just trying to get two peices of data from it, i tried to emulate the nature of what was already written.
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 03:53 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.04343 seconds
  • Memory Usage 2,309KB
  • Queries Executed 24 (?)
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
  • (8)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete