![]() |
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:
PHP Code:
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:
|
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 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.
|
and how to go one more page back ?
|
You can't, unless you keep passing the value on...
|
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 Thank You |
PHP Code:
|
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'])); It displays simple "Array" and no list boxes are displayed too |
Ofcourse, you are creating an array with explode().
|
ya I can notice that explode is creating a problem. So, how to get it working plz.. ?
|
Well i don't know what you are trying with that explode, so no clue how to correct it. But i doubt you need it at all, try removing it.
|
You wanted to separate all the "time values" and use them in select boxes - so just use the variables $day, $month, $year, etc., as defined by list().
Do you know what list() does? |
I had got it working but the small problem that remained with list() was that it INSERTED the selected value at the top in the list box rather than CHOOSING.
So, after lot of fiddling and referring to profile.php (modifyprofile_birthday template) I reached to this:- PHP Code:
HTML Code:
<option value="1" $dayselected[1]>01</option> Thanks |
Errr - my code does exactly the same as yours - assigning $year/$hour/etc...
PHP Code:
|
okk.. I am facing a strange problem now with list boxes.
I am retreiving a score of 1 to 10 in list box. The number 10 is never retrieved/selected. Only happening with 10. I have this in PHP PHP Code:
HTML Code:
<select name="scscore" size="1" id="scscore"> Thanks |
Have you tried debugging it yourself? Checking every step for the value?
|
oh yes sir, I did check everything, then only i posted.
strange thing is that the scores 1 - 9 are retrieving fine. Its just happening with number 10. When I use text field, it shows fine. Its just some problem with list box selecting 10. And I just noticed that it is happening with every two digit number like 11, 12 etc. They aren't being selected in the list box. Something with arrays ? |
Are you sure you have the '10' entry in the array. Arrays are 0-based, so 10 entries wil have the values 0-9.
|
|
Can somebody please please look into my problem..... I am not able to figure this out.
I am retrieving a score of 1 to 10 in list box. The number 10 is never retrieved/selected. Only happening with 10. However, 1 to 9 retrieve okay. 10 does show using text field BUT not in list box. I have this in PHP:- PHP Code:
HTML Code:
<select name="scscore" size="1" id="scscore"> Thank you.. any help is much appreciated ! |
What is the value of $result['colscore']?
|
any integer between 1 to 10. But when 10 is the value, it doesn't select in list box !
|
Is that value "10" when it's meant to be "10"?
|
YES... sure !
I told in my second last post that 10 displays fine when using text-field BUT does not select through list box. |
Then what are you trying with:
PHP Code:
PHP Code:
|
Quote:
BUT I just figured it out and this WORKED:- PHP Code:
I just put explode and its working perfect. But may I know plz what explode did, that the list box is now selecting 2 digit numbers. |
An explode makes $result['colscore'] an array, since it is the first and only element, it is assigned the ID of 0. You know you could just have done this:
PHP Code:
|
I have a similar problem again but this time related to retrieving text values in select box.
I have this in template:- HTML Code:
<select name="category" size="1" id="category"> Suppose, the value in the database is Technology, How do I retrieve it automatically selected in the select box. Thank you |
All times are GMT. The time now is 01:32 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|