[Mod Release] Assig...
 
Notifications
Clear all

[Mod Release] Assigning a skin to a single category

15 Posts
4 Users
0 Reactions
2,828 Views
(@itanshi)
Posts: 381
Reputable Member
Topic starter
 

I understand most of the concept. First I use the extra_header.php and a variation of <? $current == "browse" echo "<link...>" ?>. I need a way to say in PHP "If this url is accessed output this stylesheet"

---

Gotten from below, thanks again.

Applying a specific stylesheet. Find this line in "header.php":

echo "</head>";

and before it insert:

if ($_GET['id'] == 153) {
echo '<link rel="stylesheet" type="text/css" href=""skins/SKIN_NAME/FILE_NAME.css">';"
}

To apply a specific skin. Find this line in "header.php":

else $skindir = _BASEDIR."default_tpls";

After it add:

if ($_GET['id'] == 153) {
$skindir = _BASEDIR. 'skins/SKIN_NAME';
}

I am rebuilding efiction! Join us on irc! #efiction at www.mibbit.com Instructions for irc πŸ˜€ Alpha released!

 
Posted : 22/11/2007 3:53 am
 Elle
(@jenny)
Posts: 594
Honorable Member
 

<?php
  if ($current == "browse") { echo "<link ...>"
  } elseif {

[...]

?>

Perhaps? :3


archive: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 22/11/2007 1:20 pm
(@itanshi)
Posts: 381
Reputable Member
Topic starter
 

That will make every page called 'browse' show the skin change. That means every category, thanks tho.


I am rebuilding efiction! Join us on irc! #efiction at www.mibbit.com Instructions for irc πŸ˜€ Alpha released!

 
Posted : 22/11/2007 1:45 pm
 Elle
(@jenny)
Posts: 594
Honorable Member
 

OH! In that case use $catid. πŸ™‚

Sorry!


archive: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 22/11/2007 2:04 pm
(@itanshi)
Posts: 381
Reputable Member
Topic starter
 

hmm didn't do it, am i missing a syntax? I don't believe that variable is accessible from here. The syntax should be right. I tried id =="153" as well without any change.


I am rebuilding efiction! Join us on irc! #efiction at www.mibbit.com Instructions for irc πŸ˜€ Alpha released!

 
Posted : 23/11/2007 12:24 am
(@carissa)
Posts: 791
Member Moderator
 

I don't think that code is going to work anyway. I'm pretty sure echo is not the right function. I could be wrong though...


 
Posted : 23/11/2007 8:04 pm
(@itanshi)
Posts: 381
Reputable Member
Topic starter
 

echo is what php uses as a 'print' function, so i am assuming its the variable privilege that is at issue if not the variable name i need to use. My knowledge is limited, admittedly.


I am rebuilding efiction! Join us on irc! #efiction at www.mibbit.com Instructions for irc πŸ˜€ Alpha released!

 
Posted : 23/11/2007 10:59 pm
(@carissa)
Posts: 791
Member Moderator
 

I know what echo does and from what I can tell, it will just print the url on the page instead of in the address bar.


 
Posted : 23/11/2007 11:34 pm
(@itanshi)
Posts: 381
Reputable Member
Topic starter
 

Ah my mistake, i see what you  mean now. echoe prints the CSS file i need, so no it wouldn't grab anything.


I am rebuilding efiction! Join us on irc! #efiction at www.mibbit.com Instructions for irc πŸ˜€ Alpha released!

 
Posted : 23/11/2007 11:53 pm
(@eyedam)
Posts: 64
Trusted Member
 

Do you want the skin to appear only for the story listings of the particular category, or also on the story pages themselves?


The wireless music box has no imaginable commercial value. Who would pay for a message sent to nobody in particular? (1920)

 
Posted : 24/11/2007 6:53 am
(@itanshi)
Posts: 381
Reputable Member
Topic starter
 

the specific category liist, so like here
http://fanforge.net/browse.php?type=categories&id=153


I am rebuilding efiction! Join us on irc! #efiction at www.mibbit.com Instructions for irc πŸ˜€ Alpha released!

 
Posted : 24/11/2007 12:35 pm
(@eyedam)
Posts: 64
Trusted Member
 

Open "header.php" and find line:

else $skindir = _BASEDIR."default_tpls";

After it add:

if ($_GET['id'] == 153) {
$skindir = _BASEDIR. 'skins/dark2';
}

The wireless music box has no imaginable commercial value. Who would pay for a message sent to nobody in particular? (1920)

 
Posted : 24/11/2007 2:56 pm
(@itanshi)
Posts: 381
Reputable Member
Topic starter
 

worked great, although it is acting up. (skin is out of date, not the code) I made a change to it to better reflect my goal. A small css file would serve better than an entire skin, although I presume i could better organize things somehow. Anyways, the code as follows.

else $skindir = _BASEDIR."default_tpls";
if ($_GET['id'] == 153) {
echo "<link rel="stylesheet" type="text/css" href=""skins/default/precure.css"" />";
}

For some reason even if i remove the linked profile as shown the fonts changed size on me and no where in the css tells me why.
http://fanforge.net/browse.php?type=categories&id=153


I am rebuilding efiction! Join us on irc! #efiction at www.mibbit.com Instructions for irc πŸ˜€ Alpha released!

 
Posted : 25/11/2007 8:56 am
(@eyedam)
Posts: 64
Trusted Member
 

If you want to add an extra CSS file instead of changing the whole skin, find this line in "header.php":

echo "</head>";

and before it insert:

if ($_GET['id'] == 153) {
echo '<link rel="stylesheet" type="text/css" href=""skins/default/precure.css">';"
}

The wireless music box has no imaginable commercial value. Who would pay for a message sent to nobody in particular? (1920)

 
Posted : 25/11/2007 9:24 am
(@itanshi)
Posts: 381
Reputable Member
Topic starter
 

thanks so much, solved now. I'll change it more later, but for now i have an image in the top right corner.


I am rebuilding efiction! Join us on irc! #efiction at www.mibbit.com Instructions for irc πŸ˜€ Alpha released!

 
Posted : 25/11/2007 12:12 pm
Share: