![]() |
iam stuck with my modification
hey, i hope i got the right forum for my little 'request'. :)
I have added a new column called 'onfrontpage' to the 'thread' table. When i make a new thread there's a little selectbox where i can choose something like "is on frontpage". When i select "yes" the column 'onfrontpage' for this thread is filled with '1'. Otherwise it's '0'. Now here's my problem: I wan't to have a little '<input type="checkbox">' on showthread.php that shows if this thread is currently on the frontpage (if the columns 'onfrontpage' says '1') so that i can easily change it. But how do i do that? I've been working on that for 4 hours now but i didn't figure out how to do that yet :( I can't select the value of 'onfrontpage' out of the database. It must be somewhere hidden in the showthread.php or functions_showthread.php. Is there someone with too much spare time who is willing to help me? It doesn't need to be a detailed instruction, some hints are more than welcome :) regards, dominik |
I believe it should be automatically loaded with your thread cache... Check $threadinfo['onfrontpage'] and see if it holds your variable?
|
Well, that did the trick. I deleted that and replaced it with $show[onfrontpage] and that didn't work :(
Thanks alot :) my next problem: i added the following to the SHOWTHREAD-template Code:
<div><label for="cb_onfrontpage"><input type="checkbox" name="do" value="onfrontpage" id="cb_onfrontpage" tabindex="1" $checked[onfrontpage] />Auf der Startseite?</label></div> Code:
// ############################### start do set on frontpage ############################### If i change $threadinfo[onfrontpage] to '1' or '0' manually he'll change it in the database... wrong variable i try to use? |
In your query:
"onfrontpage = $threadinfo[onfrontpage]" You don't want to set the onfrontpage to the $threadinfo value, you want to set it to the form value. I would replace the checkbox value with "1" so that it will feed the database a 1 if it is checked. |
I changed it to
Code:
<div><label for="cb_onfrontpage"><input type="checkbox" name="onfrontpage" value="1" id="cb_onfrontpage" tabindex="1" $checked[onfrontpage] />Auf der Startseite?</label></div> |
Try these:
Code:
<div><label for="cb_onfrontpage"><input type="checkbox" name="onfrontpage" value="1" id="cb_onfrontpage" tabindex="1" $checked[onfrontpage] />Auf der Startseite?</label></div> Code:
// ############################### start do set on frontpage ############################### |
hm that would work but not as i expected.
How can i set onfrontpage to '0' ? I want it so that you can select with the checkbox if the the post is on the frontpage (onfrontpage = '1') or not (onfrontpage = '0'). With your code it can only set it to '1' but not to '0'. |
Well I don't know where this code is going, so I don't know if it has access to a current $threadinfo... if it does, this would work:
Code:
// ############################### start do set on frontpage ############################### |
this code is going to options.php line 143 :)
|
do you mean postings.php? If so, it should have threadinfo and that should work.
|
I think i got it...
Code:
// ############################### start do set on frontpage ############################### |
Ah yup, make the value 0 instead of blank.. congrats :D
|
thank you man, you are my hero ;)
One last thing but i think i can figure that out on my own. The thread tools always has "close thread" or "open thread" as a default. (because it's a radio button) That means if i select 'to frontpage' it automatically selects 'close' or 'open' and that's quite annoying :D |
One last thing: I try to get the first post of each thread marked with "onfrontpage" out of the database. Iam using the following query but i doesn't work :(
Code:
$getnews = $DB_site->query(" Code:
Database error in vBulletin 3.0.0 Release Candidate 4: |
Quote:
I guess the second left join comes form $previewjoin. |
All times are GMT. The time now is 01:14 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:
|