vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Few vbcoding queries (https://vborg.vbsupport.ru/showthread.php?t=189898)

veenuisthebest 09-03-2008 06:25 AM

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); 


veenuisthebest 09-17-2008 06:23 PM

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

nexialys 09-17-2008 09:23 PM

$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.

veenuisthebest 09-18-2008 02:47 AM

and how to go one more page back ?

Dismounted 09-18-2008 04:21 AM

You can't, unless you keep passing the value on...

veenuisthebest 09-21-2008 05:07 PM

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

Dismounted 09-22-2008 04:40 AM

PHP Code:

$date explode('-'vbdate('j-n-Y-H-i-s'$dateline));
list(
$day$month$year$hour$minute$second) = $date


veenuisthebest 09-22-2008 09:56 AM

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

Marco van Herwaarden 09-22-2008 09:58 AM

Ofcourse, you are creating an array with explode().

veenuisthebest 09-22-2008 09:59 AM

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


All times are GMT. The time now is 03:43 AM.

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.01737 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete