View Single Post
  #41  
Old 06-13-2005, 11:12 PM
whodah whodah is offline
 
Join Date: Feb 2004
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

an update!

i'm running a nightly build (from June 2nd) w/ core: 0.9.22

this includes the new url rewrite module - which works!

i had to hardcode some links though as the gallery url rewrite takes over the vB relative links.

so i had to make the relative links 'static' in 1 template and hard code a phrase too...

the phrase i had to edit was:
private_messages_nav

from:
Code:
<a href="private.php?{3}">Private Messages</a>: {1}, {2}.
to:
Code:
<a href="http://www.domain.com/private.php?{3}">Private Messages</a>: {1}, {2}.
the template i had to edit was: navbar

and i changed all links that looked like:
Code:
<a href="profile.php?$session[sessionurl]do=editprofile">
to:
Code:
<a href="$vboptions[bburl]/profile.php?$session[sessionurl]do=editprofile">
basically added:
Code:
$vboptions[bburl]/
in front of all of the links in that page that actually go somewhere. (not the # links) there's like 20 of 'em.

you can also do random blocks and such. i'm not sure the cleanest way to do it... i've done it on our site, but it uses vbadvanced. basically, look in the gallery site admin under:
Blocks -> Random/Popular

and note the 'External Image Block' section.

at some point in yer code, you need to call a php variable to get yer random block. since we cannot do this directly from templates, we have to do it in one of the .php files and then reference the variable which introduces a level of difficulty. for instance, as that page indicates, the code:
Code:
<?php @readfile('http://www.cvreefers.org/gallery2.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=owner'); ?>
will generate a random image. as you cannot call php from our templates, i kinda kludged this together w/ vbadvanced's help.

you can then get real jiggy w/ it by calling those links in yer postbit (or postbit_legacy in our case) to produce things like each users latest album or each users random pic.

an example is here, note beneath the posters' avatar:
http://www.cvreefers.org/showthread.php?t=2614

however, each time u look up a random pic, i get a delay on a p4 3.06 w/ 1 gig of ram. so if u have 10 users browsing 17 posts w/ 10 random pic genreators at once... well... u get the idea. actually read that thread if you want to see the outcome...

so - i'm using a cron job and a hidden field to do the tricks on that page.

i hesitate to mention those above tricks because i know the first thing that's going to be asked is 'how did you do this?' and it's pretty entailed. to get the user's gallery links beneath each user involves naming an album identicle to that user, creating two hidden user profile fields, and setting up a cron job. for the daily random block, another hidden user profile field, and another cron job. i really doubt that i'm doing it 'the right way' nor the most eloquant nor the most effecient way. heck, i'm establishing my own mysql connection on those cron jobs and i'm sure i could mooch off of vB's connection if i researched how, heh! so i just wanted to show that it can be done if that makes sence! i'm sure someone more advanced then i could make it generically fit any vB install.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01272 seconds
  • Memory Usage 1,781KB
  • 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
  • (6)bbcode_code
  • (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