Skip to content

Commit

Permalink
Minor bugfixes and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pudge committed May 4, 2001
1 parent a93b534 commit a6cea55
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Slash/Install/Install.pm
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ sub _install {

if ($plugin->{"${driver}_dump"}) {
if (my $dump_file = "$plugin->{dir}/" . $plugin->{"${driver}_dump"}) {
open(DUMP, "< $dump_file");
open(DUMP, "< $dump_file") or warn "Can't open $dump_file: $!";
while (<DUMP>) {
next unless /^INSERT/;
chomp;
Expand Down
14 changes: 14 additions & 0 deletions plugins/Journal/Journal.pm
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,20 @@ sub friends {
return $friends;
}

sub reverse_friends {
my($self) = @_;
my $uid = $ENV{SLASH_USER};
my $sql;
$sql .= " SELECT u.nickname, j.uid";
$sql .= " FROM journal_friends as j, users as u";
$sql .= " WHERE j.friend = $uid AND j.uid = u.uid";
$sql .= " GROUP BY u.nickname ORDER BY uid ASC";
$self->sqlConnect;
my $friends = $self->{_dbh}->selectall_arrayref($sql);

return $friends;
}

sub add {
my($self, $friend) = @_;
my $uid = $ENV{SLASH_USER};
Expand Down
5 changes: 2 additions & 3 deletions plugins/Journal/dump
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('journal','Rea
INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('journal','Top 10','[% constants.rootdir %]/journal.pl?op=top',0,4);
INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('journal','View Friends','[% constants.rootdir %]/journal.pl?op=friends',0,5);

INSERT INTO vars (name, value, description) VALUES ('journal_top', '30', 'How many Journals to display in the tops page');
INSERT INTO vars (name, value, description) VALUES ('journal_user_count', '5', 'How many Journals to display on the user\'s pagepage');
INSERT INTO vars (name, value, description) VALUES ('journal_default_display', '0', 'Default number of journals to display on a users page');
INSERT INTO vars (name, value, description) VALUES ('journal_top', '30', 'Number of journals to display in the top page');
INSERT INTO vars (name, value, description) VALUES ('journal_default_display', '10', 'Number of journals to display on a user\'s page');
INSERT INTO vars (name, value, description) VALUES ('journal_default_theme', 'generic', 'Default theme to use on journal entries');
14 changes: 7 additions & 7 deletions plugins/Journal/journal.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
# $Id$

use strict;
use Slash;
use Slash::DB;
use Slash::Utility;
use Slash::Journal;
use Slash::Display;
use Apache;
use Date::Manip;
use XML::RSS;
use Apache;

use Slash;
use Slash::DB;
use Slash::Display;
use Slash::Journal;
use Slash::Utility;

sub main {
my %ops = (
Expand Down Expand Up @@ -314,7 +314,7 @@ sub addFriend {
}

sub deleteFriend {
my ($form, $journal) = @_;
my($form, $journal) = @_;

$journal->delete($form->{uid}) if $form->{uid} ;
displayDefault(@_);
Expand Down
3 changes: 3 additions & 0 deletions themes/slashcode/templates/dispStory;misc;light
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ END %]

[% story.introtext %]

[% IF full && (story.bodytext || story.books_publisher) %]<P>

[% story.bodytext %][% END %]
__seclev__
10000

0 comments on commit a6cea55

Please sign in to comment.