Donkey
Junior Member
Posts: 10
Joined: Jul 2009
Reputation: 0
Thanked 0 Times in 0 Posts MyBux: 0
|
|
| 07-22-2009 09:35 PM |
|
LosTZealoT
Junior Member
Posts: 6
Joined: Jul 2009
Reputation: 0
Thanked 0 Times in 0 Posts MyBux: 0
|
RE: Custom Pages
Ive looked through this thread a bit, but have not found an answer. Do custom pages support php and/or Javascript?
Because when I tried adding a script tag for Javascript and tried a simple document.write(), I couldnt get it to work. I got the page and the myBB table, but nothing was writen inside.
Also, whenever I tried adding PHP tags (<?php ... ?>) and a simple echo(); command, I get this error:
Code:
Parse error: syntax error, unexpected '>' in /home/jaketfg/public_html/lostzealot/pages/index.php(74) : eval()'d code on line 1
Not sure if I did something wrong or what, but it would really be great if I could code PHP on my pages...
|
|
| 07-23-2009 01:10 PM |
|
wWs
Junior Member
Posts: 6
Joined: Feb 2009
Reputation: 0
Thanked 0 Times in 0 Posts MyBux: 6
|
|
| 07-24-2009 06:21 AM |
|
Nickman
Manager
Posts: 1,905
Joined: May 2008
Reputation: 37
Thanked 31 Times in 16 Posts MyBux: 936
|
RE: Custom Pages
(07-23-2009 01:10 PM)LosTZealoT Wrote: Ive looked through this thread a bit, but have not found an answer. Do custom pages support php and/or Javascript?
Because when I tried adding a script tag for Javascript and tried a simple document.write(), I couldnt get it to work. I got the page and the myBB table, but nothing was writen inside.
Also, whenever I tried adding PHP tags (<?php ... ?>) and a simple echo(); command, I get this error:
Code:
Parse error: syntax error, unexpected '>' in /home/jaketfg/public_html/lostzealot/pages/index.php(74) : eval()'d code on line 1
Not sure if I did something wrong or what, but it would really be great if I could code PHP on my pages...
Javascript you should be able to do as long as you don't use Design mode. PHP must be done in the PHP box and not in the actual content box.
My Blog
|
|
| 07-24-2009 06:36 AM |
|
LosTZealoT
Junior Member
Posts: 6
Joined: Jul 2009
Reputation: 0
Thanked 0 Times in 0 Posts MyBux: 0
|
RE: Custom Pages
But it seems as if the PHP is run before the page, so I cannot put things in the page with that data. What I am trying to do is create a few pages that allow users to modify groups without ACP access. Im using user groups like ranks for a clan forum and using custom pages I hoped to add a promotion/demotion system using custom pages, seeing as myBB seems to have no plugins or features that can do this(Group Promotions in the ACP are only based on time/posts/rep; I need group promotions to be decided by higher groups).
Thus, in order to form a list of all users whom the user using the page can modify, I need to access the MySQL database and run a loop to create the pulldown menu for selection.
Is there any way to get this data and create the form(pulldown menu) on a custom page?
|
|
| 07-24-2009 07:59 AM |
|
Polarbear541
Tuts Team
Posts: 806
Joined: Aug 2008
Reputation: 3
Thanked 0 Times in 0 Posts MyBux: 856
|
RE: Custom Pages
Just use the html for a dropdown box:
Code:
<select name="dropdown"><option>Option 1</option></select>
|
|
| 07-25-2009 07:13 PM |
|
LosTZealoT
Junior Member
Posts: 6
Joined: Jul 2009
Reputation: 0
Thanked 0 Times in 0 Posts MyBux: 0
|
RE: Custom Pages
For course, but the issue is that the drop down box must be made up of a list of members with User Group ID < x-2; x being the User Group ID of the member viewing the page. That means that I have to get data from the MySQL database in order to create the drop down box's content. I cant think of a good way of doing that; unless I can use the PHP before the page to get the list then use Javascript in the page itself to create the dropdown box using the data PHP pulled from the data base. However, I know of no way for Javascript to access the database directed, cutting out the need for PHP, or get the data PHP pulled into the page for the Javascript to use, aka sending data from PHP to Javascript. I;ve looked online and found that I can use a form to send data between the two, yet in this case, the form will not work as the PHP is run before the page, NOT on the page before.
|
|
| 07-26-2009 06:19 AM |
|