CssWork: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 14: | Line 14: | ||
* slashcode_lite.css?T_2_5__0_272 (appears to be loading this twice,why?) | * slashcode_lite.css?T_2_5__0_272 (appears to be loading this twice,why?) | ||
* print.cssT_2_5__0_272 | * print.cssT_2_5__0_272 | ||
<h3>Follow a page link from the main page to an individual article page </h3> | |||
* Link: http://soylentnews.org/article.pl?sid=14/02/18/0336229 | |||
* article.pl is foind in slash/themes/slashcode/htdocs/article.pl So 'slashcode' is treated as a theme. | |||
<h4>article.pl</h4> | |||
The stuff of interest to us | |||
<pre> | |||
use Slash; | |||
use Slash::Display; | |||
use Slash::Utility; | |||
sub main { | |||
my $slashdb = getCurrentDB(); | |||
my $constants = getCurrentStatic(); | |||
my $user = getCurrentUser(); | |||
my $form = getCurrentForm(); | |||
my $gSkin = getCurrentSkin(); | |||
my $story; | |||
my $reader = getObject('Slash::DB', { db_type => 'reader' }); | |||
# Make sure the reader is viewing this story in the | |||
# proper skin. | |||
my $cur_skid = determineCurrentSkin(); | |||
if ($story->{primaryskid} != $cur_skid) { | |||
my $cur_skin = $reader->getSkin($cur_skid); | |||
my $story_skin = $reader->getSkin($story->{primaryskid}); | |||
if ($story_skin && $story_skin->{rootdir} | |||
&& $story_skin->{rootdir} ne $cur_skin->{rootdir})$ | |||
redirect("$story_skin->{rootdir}$ENV{REQUEST_URI}"$ | |||
return; | |||
# XXXSECTIONTOPICS this needs to be updated | |||
my $SECT = $reader->getSection($story->{section}); | |||
# This should be a getData call for title | |||
my $title = "$constants->{sitename} | $story->{title}"; | |||
if ($gSkin->{name} && $gSkin->{name} eq "idle") { | |||
$title = "$gSkin->{hostname} | $story->{title}"; | |||
if (my $pollbooth_db = getObject('Slash::PollBooth')) { | |||
slashDisplay('display', { | |||
poll => $pollbooth, | |||
section => $SECT, | |||
section_block => $reader->getBlock($SECT->{secti$ | |||
show_poll => $pollbooth ? 1 : 0, | |||
story => $story, | |||
stories => \%stories, | |||
}); | |||
my $called_pc = 0; | |||
if ($story->{discussion}) { | |||
# Still not happy with this logic -Brian | |||
my $discussion = $reader->getDiscussion($story->{discussio$ | |||
} | |||
# If no comments ever have existed and commentstatus is di$ | |||
# just skip the display of the comment header bar -Brian | |||
&& $discussion->{commentstatus} eq 'disabled' | |||
)) { | |||
printComments($discussion); | |||
$called_pc = 1; | |||
} | |||
if (!$called_pc && $form->{ssi} && $form->{ssi} eq 'yes' && $form-$ | |||
# This is a real hack, we're kind of skipping down | |||
# two levels of code. But the cchp printing is an | |||
# important optimization; we avoid having to do | |||
# multiple expensive comment selects. One problem | |||
# is that if there's no discussion with a story, | |||
# printComments() doesn't get called, which means | |||
# selectComments() doesn't get called, which means | |||
# the cchp file won't be written. If article.pl | |||
# is being called by slashd, and we need to write | |||
# that file, then here's where we print an empty | |||
# file that will satisfy slashd. - Jamie | |||
Slash::Utility::Comments::_print_cchp({ stoid => "dummy" }$ | |||
} | |||
} else { | |||
header('Error', $form->{section}) or return; | |||
my $plugins = $slashdb->getDescriptions('plugins'); | |||
if (!$user->{is_anon} && $plugins->{Tags} && $story) { | |||
my $tagsdb = getObject('Slash::Tags'); | |||
$tagsdb->markViewed($user->{uid}, | |||
$reader->getGlobjidCreate('stories', $story->{stoid})); | |||
} | |||
footer(); | |||
if ($story) { | |||
writeLog($story->{sid} || $sid); | |||
} else { | |||
writeLog($sid); | |||
createEnvironment(); | |||
main(); | |||
1; | |||
(EOF) | |||
</pre> |
Revision as of 00:55, 19 February 2014
This is a title
The is an index for css discoveries, etc. Testing idea... Brought to you by the Frontend Team.
test
Order css files are loaded when simple switch on user prefs page is selected viewing main page main page
- base.css?T_2_5_0_272
- slashcode.css?T_2_5__0_272
- slashcode_lite.css?T_2_5__0_272
- slashcode_lite.css?T_2_5__0_272 (appears to be loading this twice,why?)
- print.cssT_2_5__0_272
Follow a page link from the main page to an individual article page
- Link: http://soylentnews.org/article.pl?sid=14/02/18/0336229
- article.pl is foind in slash/themes/slashcode/htdocs/article.pl So 'slashcode' is treated as a theme.
article.pl
The stuff of interest to us
use Slash; use Slash::Display; use Slash::Utility; sub main { my $slashdb = getCurrentDB(); my $constants = getCurrentStatic(); my $user = getCurrentUser(); my $form = getCurrentForm(); my $gSkin = getCurrentSkin(); my $story; my $reader = getObject('Slash::DB', { db_type => 'reader' }); # Make sure the reader is viewing this story in the # proper skin. my $cur_skid = determineCurrentSkin(); if ($story->{primaryskid} != $cur_skid) { my $cur_skin = $reader->getSkin($cur_skid); my $story_skin = $reader->getSkin($story->{primaryskid}); if ($story_skin && $story_skin->{rootdir} && $story_skin->{rootdir} ne $cur_skin->{rootdir})$ redirect("$story_skin->{rootdir}$ENV{REQUEST_URI}"$ return; # XXXSECTIONTOPICS this needs to be updated my $SECT = $reader->getSection($story->{section}); # This should be a getData call for title my $title = "$constants->{sitename} | $story->{title}"; if ($gSkin->{name} && $gSkin->{name} eq "idle") { $title = "$gSkin->{hostname} | $story->{title}"; if (my $pollbooth_db = getObject('Slash::PollBooth')) { slashDisplay('display', { poll => $pollbooth, section => $SECT, section_block => $reader->getBlock($SECT->{secti$ show_poll => $pollbooth ? 1 : 0, story => $story, stories => \%stories, }); my $called_pc = 0; if ($story->{discussion}) { # Still not happy with this logic -Brian my $discussion = $reader->getDiscussion($story->{discussio$ } # If no comments ever have existed and commentstatus is di$ # just skip the display of the comment header bar -Brian && $discussion->{commentstatus} eq 'disabled' )) { printComments($discussion); $called_pc = 1; } if (!$called_pc && $form->{ssi} && $form->{ssi} eq 'yes' && $form-$ # This is a real hack, we're kind of skipping down # two levels of code. But the cchp printing is an # important optimization; we avoid having to do # multiple expensive comment selects. One problem # is that if there's no discussion with a story, # printComments() doesn't get called, which means # selectComments() doesn't get called, which means # the cchp file won't be written. If article.pl # is being called by slashd, and we need to write # that file, then here's where we print an empty # file that will satisfy slashd. - Jamie Slash::Utility::Comments::_print_cchp({ stoid => "dummy" }$ } } else { header('Error', $form->{section}) or return; my $plugins = $slashdb->getDescriptions('plugins'); if (!$user->{is_anon} && $plugins->{Tags} && $story) { my $tagsdb = getObject('Slash::Tags'); $tagsdb->markViewed($user->{uid}, $reader->getGlobjidCreate('stories', $story->{stoid})); } footer(); if ($story) { writeLog($story->{sid} || $sid); } else { writeLog($sid); createEnvironment(); main(); 1; (EOF)