Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 09-03-2008, 07:25 AM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Few vbcoding queries

1. vB uses this code to redirect to any location (in our case page.php), how do I redirect to previous page that user accessed?

PHP Code:
$vbulletin->url "page.php" $vbulletin->session->vars['sessionurl'];
  if (isset(
$_SERVER['QUERY_STRING'])) {
eval(
print_standard_redirect('redirect_linkdir'truetrue));} 
I then found this:-

PHP Code:
require_once(DIR '/includes/functions_login.php');    
$vbulletin->url fetch_replaced_session_url($vbulletin->url); 
But it isn't working for me. How do I go a couple of pages back from history ?

2. How do I create online locations for my sub-pages like for do=this and do=that

3. After reading Send PMs (automatically), it was easy to send PM's. Just have a few queries, what does $pmdm->set_info('is_automated', true); AND cache_permissions($fromuser, false); does ? coz I can't see any difference with/without them.

4. How do we use vbmail function in our page? I think there's something wrong in my code as I am getting very late mails OR not getting them at all. The other default mailing functions are working perfect i.e. I receive mails instantly when using contact us or any other email function but only not through my custom page.

PHP Code:
$emailto "email@email.com";
$subject "my email subject";
$message "my message body";
vbmail($emailto$subject$message); 
Reply With Quote
  #2  
Old 09-17-2008, 07:23 PM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i am still waiting... !!!!!

The main problem i am facing is with my first question. What the problem is that I have to create similar two sub-pages just because I want both of them to redirect at different locations on submitting the form.

For ex. with the below code in page.php?do=this, it would redirect to page2.php. Now how to redirect the same to page3.php depending on the source page from where the user accessed page.php?do=this

PHP Code:
$vbulletin->url "page2.php" $vbulletin->session->vars['sessionurl'];
  if (isset(
$_SERVER['QUERY_STRING'])) {
eval(
print_standard_redirect('redirect_linkdir'truetrue));} 
Thanks
Reply With Quote
  #3  
Old 09-17-2008, 10:23 PM
nexialys
Guest
 
Posts: n/a
Default

$vbulletin->url already contain the referer page the user was on before clicking the link/button ... if you modify that variable, it is renewed to your new value.
Reply With Quote
  #4  
Old 09-18-2008, 03:47 AM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

and how to go one more page back ?
Reply With Quote
  #5  
Old 09-18-2008, 05:21 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can't, unless you keep passing the value on...
Reply With Quote
  #6  
Old 09-21-2008, 06:07 PM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

alright thanks for the help uptill now.

A small question plz:-

I am storing date in unix timestamp format and retrieve it with vbdate(). Fine ! It simply displays in text field.

But I want to retreive it just the way vb does it i.e. in combo/list boxes so that i can edit/update it.

Code:
Month     Date     Year     HH  MM  SS
How to retrieve it in the above format in list boxes with correct date/time selected.

Thank You
Reply With Quote
  #7  
Old 09-22-2008, 05:40 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$date explode('-'vbdate('j-n-Y-H-i-s'$dateline));
list(
$day$month$year$hour$minute$second) = $date
Reply With Quote
  #8  
Old 09-22-2008, 10:56 AM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh can't get it work !

see I have this in my PHP

Code:
$row_timestamp = explode('-', vbdate('j-n-Y-H-i-s', $result['TIMESTAMP']));
list($day, $month, $year, $hour, $minute, $second) = $row_timestamp;
and $row_timestamp in template.

It displays simple "Array" and no list boxes are displayed too
Reply With Quote
  #9  
Old 09-22-2008, 10:58 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ofcourse, you are creating an array with explode().
Reply With Quote
  #10  
Old 09-22-2008, 10:59 AM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ya I can notice that explode is creating a problem. So, how to get it working plz.. ?
Reply With Quote
Reply

Thread Tools
Display Modes

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 07:02 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04574 seconds
  • Memory Usage 2,265KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (9)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete