View Full Version : Styles In Admin Panel
webhost
07-20-2001, 01:30 PM
When inside the admin control panel and selecting edit
under styles you can change color options! Under Calendar
colors I would like to add another entry to this say for a
chat event and be able to select different colors for this. Can this be done? If so how please
Mike Sullivan
07-20-2001, 02:27 PM
You'd have to hack admin/style.php then, or you can just add a replacement variable for it directly through the replacement system.
webhost
07-20-2001, 02:34 PM
// *** calendar colors ************************************************
maketableheader("Calendar Colors","calendarcolors");
makestyleeditor("calbgcolor","Background Color",1);
makestyleeditor("caltodaycolor","Today Background Color",1);
makestyleeditor("caldaycolor","Calendar Date Font Color",1);
makestyleeditor("calbirthdaycolor","Birthday Font Color",1);
makestyleeditor("calprivatecolor","Private Event Font Color",1);
makestyleeditor("calpubliccolor","Public Event Font Color",1);
makestyleeditor("chatcolor","Chat Event Font Color",1); restarttable();
I added the line about chatcolor it shows up; down in cp under styles BUT when i change the color to say #0000ff it does change the block color to the right but when I save and go back and look the 0000ff is not there it is just blank.? color block grey
Mike Sullivan
07-20-2001, 02:52 PM
Being a hack, we can't really support any code changes. Especially since the style editor wasn't designed to handle custom replacements it seems. Hence I suggest adding the replacements directly through the replacement system.
webhost
07-20-2001, 02:57 PM
I think I might have to do something different. What I am doing is adding chat events to the calendar. I have made 2 templates calendar_chatevent and calendar_chateventbutton and I am in the process of modifing calendar.php so I'm hoping someway the styles.php change could work it would make life easier.
webhost
07-20-2001, 06:30 PM
Ed, I got style addition working. I not only
had to add line above to style.php but I also
had to add variable called {chatcolor} once I
did this it worked the way it should. I have
another problem now with calendar.php file.
I added the following code and I get a error
on line 189 below. Can you tell me what I am
doing wrong?
$eventid = $event[eventid];
if ($event[public] == 1) // Public Event
{
eval ("\$userevents .= \"".gettemplate("calendar_publicevent")."\";");
}
elseif // Chat Event line 188
} line 189
eval ("\$userevents .= \"".gettemplate("calendar_chatevent")."\";");
}
else // Private Event
{
eval ("\$userevents .= \"".gettemplate"calendar_privateevent")."\";");
}
}
}
}
==========================
This is what it was
==========================
$eventid = $event[eventid];
if ($event[public] == 1) // Public Event
{
eval ("\$userevents .= \"".gettemplate("calendar_publicevent")."\";");
}
else // Private Event
{
eval ("\$userevents .= \"".gettemplate"calendar_privateevent")."\";");
}
}
}
}
Freddie Bingham
07-20-2001, 06:38 PM
Change the } to a { (on line 189)
webhost
07-20-2001, 06:41 PM
I did I will try again I got the same error when I changed it the other way.
webhost
07-20-2001, 06:47 PM
I changed it got the same error.
Parse error: parse error, expecting `'('' in /home/realweb/public_html/forums/calendar.php on line 189
Freddie Bingham
07-20-2001, 07:05 PM
Well you also have elseif with nothing following it so change that to else or put some equality in there. i.e. elseif (1 == 1 )
webhost
07-20-2001, 07:45 PM
ok freddie that worked that also helped with about 4 more lines. Now I am stuck here. On line 544 on 543 I tried like this 1==1) and I also tried on 544 changing } to { no luck.
if ($info[public] == 1)
{
$user = $info[username];
eval ("\$postedby = \"".gettemplate("calendar_postedby")."\";");
$type = "Public";
}
elseif ($info[Chat] (1==1)
} Line 544
user = $info[username];
eval ("\$postedby = \"".gettemplate("calendar_postedby")."\";");
$type = "Chat";
}
else
{
unset($postedby);
$type = "Private";
}
Freddie Bingham
07-20-2001, 07:51 PM
I just used (1 == 1 ) as an example, you don't want to put that in as it always equates to true;if ($info[public] == 1) {
$user = $info[username];
eval ("\$postedby = \"".gettemplate("calendar_postedby")."\";");
$type = "Public";
} elseif ($info[Chat] == 1) {
user = $info[username];
eval ("\$postedby = \"".gettemplate("calendar_postedby")."\";");
$type = "Chat";
} else {
unset($postedby);
$type = "Private";
}
Perhaps somethins like that would work as I don't know what the $info[] array is coming from or it's purpose.
webhost
07-20-2001, 08:31 PM
ok freddie I had 2 other places but I was able to clear those up. The calendar page opens up now but I don't see the extra button I am trying to get there. I changed the style.php and added a color block in the control panel added a variable for it and it works. I then made 2 templates called calendar_chatevent and calendar_chateventbutton, I then modified calendar.php Did I miss something somewhere. Boy for working all day on something this is disappointing. Any ideas?
webhost
07-21-2001, 01:56 AM
Ok update all done Having one small problem look at script below you will see it needs to pull from 3 templates. The way the script is now its using the private event for both itself and also for the chat event. This mainly has to do with text color, Can someone tell me how to fix this. I have template for private setup for #880000 and chat event template setup for #669933 but text for both showup as #880000. Public event is setup for #000088 and it works right. I have narrowed it down to this part of calendar.php Hopefully someone can see the problem.
$eventid = $event[eventid];
if ($event[public] == 1) // Public Event
{
eval ("\$userevents .= \"".gettemplate("calendar_publicevent")."\";");
}
elseif ($event[public] == 1) // Chat Event
{
eval ("\$userevents .= \"".gettemplate("calendar_chatevent")."\";");
}
else // Private Event
{
eval ("\$userevents .= \"".gettemplate("calendar_privateevent")."\";");
}
}
}
}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.