![]() |
What I'm working on is changing the Forum Rules, in some places, from the actual list of rules, to a link that will pop up a window with the rules there. Sort of like the Get More link in the smilies box.
The specific problem I'm having is getting the forumid through the system, so it will be able to figure out just what exactly the rules are. Here's what I have so far. The link I am using to open the popup is this: PHP Code:
PHP Code:
PHP Code:
PHP Code:
Code:
<script language="Javascript" src="vbcode.js"></script> Can someone please help me with this? |
I'm pretty sure the forum array is not passed in to the vbcode.js file
just pass in the forum id the way you pass in the width, height and session hash. That should work. |
Ahh... could you please be a bit more specific on how to do that? You see, I don't actually know what I'm doing!
|
I tried making the link like this:
PHP Code:
(Note: Of course the real links do not have the space in between java and script.) |
PHP Code:
Code:
function showforumrules(x,y,sessionhash,forumid) { |
Well, the forumid number now shows up in the link, but when I click on it, it just says "Error on page" (at the bottom of IE).
|
I'm right, i ain't not javascript expert =D
Code:
function showforumrules(x,y,sessionhash,forumid) { |
Can someone please help?
|
did you add the java in the styles area, such as in the header area>? Most of the java has to go in that area, or you get a error everytime. Just rite above the <meta blah blah blah>
info. |
basically, this part would go into your styles area...above the meta tag stuff...
<!-- Pop Up--> <script language=javascript> <!-- function showforumrules(newin) { flyout=window.open(newin,"flyout","resizeable=no,s crollbars=no,toolbar=no,width= 400,height=360,top=50,left=190") } // --> </script> than, the next part would be something like this, added where you would want a form button basically.....(can use image to...not just a button, so it could go in your main menu of your forums) <form> <input type="button" name="Submit" value="Rules" onclick="showforumrules('misc.php?s=$session[sessionhash]&action=showforumrules&forumid=$forumid')"> </form> Im thinking your missing something though, because getinfo uses a $userinfo[userid] at the end of the script, and $forumid by itself doesnt look rite.... |
Now see I'm not really sure what you mean by that. Earlier when I said I don't know what I'm doing, I wasn't kidding!
But I thought that by putting the script in the vbcode.js, and that the file is called in the header section, was all that I needed? Do I need something else? |
The code that i added just above your reply, is what i used for the mood hack, just with your variables. Try using it once..it may work.... It pops open my script to display the usermood, which is a seperate script in the member.php file.
The thing that i think may hold this off, is the fact you use a $action call, which is a defined call in member.php, and showthread.php...etc... the link itself has to be somewhere defined, as a actual action call such as this if ($action == 'showforumrules') { $templatesused = "showforumrules"; include("./global.php"); you know..that type of deal... |
OK, forget my last post, I guess I was writing it at the same time you were posting your second reply. :)
But I thought that by putting the code in the vbcode.js file, that I wouldn't have to put it in the header. That's how the smilies popup window works. I basically copied the whole smilies popup and just changed which template it used (and of course the function names). The whole thing works. A window pops up. The problem is that I can't get the forumid number to get into the template that's being used. I can't get it from the link into the template. If I hardcode the forumid number, it works fine, but if I use the variable, it doesn't work. I get an error message that no forumid was specified. There must be something wrong with the syntax of the code that PPN gave in his last message; it's not properly getting the forumid number from the link. |
Quote:
|
yeh i just noticed that...sorry bout that...
i think there has to be something with the forum id bit. I do not think a person can get away, with just having $forumid at the end like that... everything, even replying to this thread, has some sort of variable tied in with it... newreply.php?s=&action=newreply&threadid= thats the trick...trying to get the forumid number in there... Think along the lines of getinfo, when you click on a username..how does it find the correct user? =&action=getinfo&userid=$userinfo[userid] so, something like this may work..dont know... =&action=showforumrules&forumid=$foruminfo[forumid] There has to be something like foruminfo, in order to kick in the id, just like getinfo uses.. Try that foruminfo code once.. |
maybe instead of $foruminfo...
try....$forumdisplay |
The forumid is determined in the link, like this:
PHP Code:
But in the meantime, I'll try the other stuff you mentioned. |
the biggest thing, is that when the $action variable is called, it needs to know where its going...
Getinfo uses the $userinfo[username] so, your script, or mine, would work, if you could pinpoint where it is, your script has to goto. the $forumid alone will not work i dont think, because there is nothing telling the script, where exactly it is supposed to go. That is why, when you hardcoded it into your addy, it worked, because it knew now where to go. The same holds true for getinfo. If you took the username part out from the little tidbit i showed you above, it would not display anything either, because it needs that username, to distinquish the username variables, and id's of all your members. That is the same for forumid...forumid needs to be whatever you numbered or set the faqs at...(when you add a new forum, there is a id that you can add, to find where it is supposed to be directed to) If the faq is in lets say...in a thread...than it would have to be something like.. http://www.vbulletin.com/forum/newre...threadid=27552 By posting the address, for this thread, you can see that 27552 is the threadid...however, what distinquishes that id? PHP Code:
You need to have something resembling that in your script... Getinfo is like this... PHP Code:
ok...im not 100% on all of this, but i am pretty sure that i am on the rite track...lol.. |
All times are GMT. The time now is 01:36 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|