View Single Post
  #237  
Old 01-09-2006, 04:43 PM
jaks jaks is offline
 
Join Date: Dec 2004
Location: Toronto
Posts: 147
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack,

I didn't want to have the large quote block at the top of every page and the Vbadvanced module you posted was a complete mess. No offence. It might be the diff between 3.5.2 and 3.5.3 but I started with a fresh 3.5.3 board yesterday and it simple destroyed the pages.

Anyway long story short, I disassemble the large block and created a sideblock module. It's not the prettiest thing and the code is messy but it works for me.

Using quote_randomquote and if anyone wants to do this here is how I broke it down:

PHP Code:
<tr colspan="2" ><td class="alt1">
<
a href="$vboptions[bburl]/quotes.php?do=addquote">$vbphrase[add_a_quote]</a><br />
<
a href="$vboptions[bburl]/quotes.php?do=list">$vbphrase[view_all_quotes]</a>
</
td></tr>
<
tr><td class="alt1">
<
a style="float:$stylevar[left];" href="$vboptions[bburl]/quotes.php?do=view&quoteid=$randomquote[quoteid]">#$randomquote[quoteid]</a> : $randomquote[author] <p>&quot;$randomquote[quote]&quot;</p>
        
<p style="font-weight:bold;margin-left:25%;">- <if condition="$randomquote[context]"> ($randomquote[context])</if></p>

<if 
condition="$vbulletin->options[ratequote]==3">
    
    
$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
<
br />    
</if>
<if 
condition="$vbulletin->options[ratequote]==1">
<
br /> <style="float:$stylevar[left];">$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]</style>
    <
br />$vbphrase[rate_this_quote]: 
    <
form name="rateplus" action="$vboptions[bburl]/quotes.php">
    <
input type="hidden" name="do" id="do" value="rate" />
    <
input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]/>
    <
input type="hidden" name="vote" id="vote" value="plus" />
    <
input type="submit" value="+" class="vote" />
    </
form>
    &
nbsp;
    <
form name="rateminus" action="$vboptions[bburl]/quotes.php">
    <
input type="hidden" name="do" id="do" value="rate" />
    <
input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]/>
    <
input type="hidden" name="vote" id="vote" value="minus" />
    <
input type="submit" value="-" class="vote" /></form>
<
br />
</if>
<if 
condition="$vbulletin->options[ratequote]==2">
    <
br />
    
$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
    <
br />$vbphrase[rate_this_quote]:</style>
    <
form name="voting" id="voting" action="$vboptions[bburl]/quotes.php">
    <
input type="hidden" name="do" id="do" value="rate" />
    <
input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]/>
    <
select name="vote" id="vote" onchange="document.voting.submit();">
    <
option value=""></option>
    <
option value="1">&nbsp;&nbsp;1&nbsp;&nbsp;</option>
    <
option value="2">&nbsp;&nbsp;2&nbsp;&nbsp;</option>
    <
option value="3">&nbsp;&nbsp;3&nbsp;&nbsp;</option>
    <
option value="4">&nbsp;&nbsp;4&nbsp;&nbsp;</option>
    <
option value="5">&nbsp;&nbsp;5&nbsp;&nbsp;</option>
    </
select>
    </
form>
    </
td></tr>
</if>
<if 
condition="$vbulletin->userinfo['permissions']['adminpermissions']">
<
tr><td  class="alt1">
<
a href="$vboptions[bburl]/quotes.php?do=delquote&quoteid=$randomquote[quoteid]">$vbphrase[delete_this_quote]</a
<
br />
<
a href="$vboptions[bburl]/quotes.php?do=editquote&quoteid=$randomquote[quoteid]">$vbphrase[edit_this_quote]</a>
</
td></tr>
</if> 
That is the whole template minus a bunch of tds. The if statements are all intact and I switch the Phrases to suit my purpose as you will see in the attached screen shot. I moved the author to the top beside the Quote # and will use it as a title. I'll use the context as author or a link. Still have some touchups to do.

Cheers Jaks
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01395 seconds
  • Memory Usage 1,852KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete