+ Post New Thread
Results 1 to 5 of 5
EduGeek Joomla 1.5 Package Thread, New approach needed for school newsletters in Projects:; On all my non-EGJP sites, (all primaries BTW) I've employed a simple system of publishing the weekly newsletter. Head/School Sec ...
  1. #1

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,720
    Thank Post
    1,451
    Thanked 580 Times in 434 Posts
    Rep Power
    165

    New approach needed for school newsletters

    On all my non-EGJP sites, (all primaries BTW) I've employed a simple system of publishing the weekly newsletter.

    Head/School Sec writes it (in Word or Publisher) and then converts it to PDF (using a virtual PDF printer) into a folder

    On static sites, they run DirHTML which produces a list of all PDFs and then they FTP the html file list and the most recent PDF up to the website.

    http://www.whitefield-pri.lancs.sch....ewsletters.htm
    [edit]url corrected[/edit]

    On my CMSimple sites they just have to upload the PDF and I've a modified small PHP script that autogenerates the webpage with the PDFs linked on it

    Euxton CE Primary School - Newsletters

    Now, I could modify the CMSimple script and turn it into a joomla module but I'm wondering whether there is a better "joomla way" of achieving the end result - easy access to current and past newsletters for the parents and easy for Head/Sec to get them online, via normal joomla editing rather than using FTP?

    What methods is everyone else using?

    regards

    Simon

  2. Thanks to SimpleSi from:

    speckytecky (26th May 2008)

  3. #2
    imullings's Avatar
    Join Date
    May 2006
    Location
    Devizes
    Posts
    30
    Thank Post
    0
    Thanked 4 Times in 3 Posts
    Rep Power
    17
    We are just setting up a new archive using docman in Joomla.
    http://www.devizesschool.co.uk/news-...archives-4.htm
    We are also setting up a mailing list to point to the PDFs
    This is still in testing so is on a test site only
    http://testsite.devizesschool.co.uk/news/
    Both are work in progress but are looking good

    Ian Mullings
    Devizes SChool IT Support

  4. 2 Thanks to imullings:

    SimpleSi (26th May 2008), speckytecky (26th May 2008)

  5. #3

    Join Date
    May 2007
    Posts
    13
    Thank Post
    1
    Thanked 4 Times in 2 Posts
    Rep Power
    15
    SimpleSi, could you share the php script you use on the CMSimple sites to autogenerate the list of newsletters? I'm using CMS Made Simple and would like to do this too but there isn't an extension for CMSMS to do this yet.

    I'm not familiar with Joomla but CMS Made Simple allows editors to upload images and files from within the normal editing area, using file and image upload managers. I'd expect Joomla to have the same. It could be possible to use these to upload the PDFs to the specified folder and then just use your existing script to display the contents of that folder - I can't see any reason why your script would care how the files reached the folder it's watching.

    Lewis

  6. #4

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,720
    Thank Post
    1,451
    Thanked 580 Times in 434 Posts
    Rep Power
    165
    @Lewis
    Here is the code to give a file listing using CMSimple

    The original code took a path and produce a nice file listing with icons.
    I modified it to only display items with a certain prefix (so I could reuse it on differnet pages - one for news one for policies etc)
    And I also added a parameter to do a sort e.g DD - date descending, (latest newsletter first on list) also does size of file e.g SD - size in descending order.

    Code:
    <?
    
    /*
    
    CMSimple WDir plugin
     2006 - Joachim Barthel - www.qualifire.de/cmsimple/en
    ---------------------------------------------------------------------
    Disclaimer:   No warranties at all, use on your own risk !
    ---------------------------------------------------------------------
    Requirements: - CMSimple 2.5 is installed and running.
                  - The plugin loader from cmsimpleplugins.svarrer.dk 
                    is installed and working !
    ---------------------------------------------------------------------
    Feedback to:  jbarthel@qualifire.de
    ---------------------------------------------------------------------
    
    Version 0.1 beta 1  (03. June 2006)
      - Support for multilingual use
      - Enhancements of display
      - first options
    
    Version 0.1 beta 1a  (04. June 2006)
      - Help files (en & de)
      - new option for summary
    
    Version 0.1 beta 2 (03. July 2006)
      - Slovak language support (Thanks to Martin Sereday)
      - Display of file attributes
      - Error trapping of wrong path
      - Formatting with CSS
      - Error on counting the files
    
    Version 0.1 beta 2a (26. July 2006)
      - Option for hidden files (starting with dot-character)
    
    Version 0.1 beta 3 (03. September 2006)
      - Show/Hide option for Size and Date columns
      - Open mode added
    
    Version modified by Simon Walters (SimpleSi) mod 1 28th April 2007
     - Only display files starting with 2nd parameter
     - Sort into Reverse Date Order
    
    Version modified by Simon Walters (SimpleSi) mod 2 29th Nov 2007
     - Only display files size in k
     - Display date in dd/mm/yyyy format
    
      
    */
    
    
    
    function wd_Version() {
       return "0.3sw2 beta";
    }
    
    //
    // simplesi change - 2 extra parameters added
    //
    function wd_list($wd_PathParam,$simplesi_FilePrefix,$simplesi_Sort) {
    
    	GLOBAL $su, $sl, $plugin_cf, $plugin_tx, $pth, $plugin;
    
    	//$wd_version = "0.1 beta 2a ";
    	error_reporting(E_ALL);
    
    	$wdo = "";
    	$wdo .= "<!-- QualiFIREs WebDirectory >>WDir<< Code starts here -->\n<div><br>\n";
    
    	if (substr($wd_PathParam,-1,1) <> "/") $wd_PathParam .= "/";
    	if (($wd_PathParam == "./") || ($wd_PathParam == "/")) $wd_PathParam = "";
    	if (substr($wd_PathParam,0,2) == "./") $wd_PathParam = substr($wd_PathParam,2);
    	$wd_path = $pth['folder']['base'] . $wd_PathParam;
    	if(eregi("true",$plugin_cf['wdir']['debug'])) {
    		$wdo .= "Path-Parameter: $wd_PathParam<br>";
    		$wdo .= "Fileserver-Dir: $wd_path<br>";
    		$wdo .= "HTTP_HOST: " . $_SERVER['HTTP_HOST'] . "<br>";
    		$wdo .= "PHP_SELF: " . $_SERVER['PHP_SELF'] . "<br>";
    		$wdo .= "<hr>";
    	}
    	$d = dir($wd_path);
    
    	$wd_fnames = array();
    	$wd_ftypes = array();
    
    //
    // simplesi change - 2 extra arrays added
    //
    	$simplesi_dates = array();
    	$simplesi_sizes = array();
    
    
    	$fcount = 0;
    	while (false !== ($entry = $d->read())) {
    		if ($entry != "." && $entry != "..") {
    			if ((eregi("true",$plugin_cf['wdir']['show_hiddenfiles'])) || (substr($entry,0,1) != '.')) {
    
    //
    // simplesi change - check if file prefix param is used
    //
    				if (($simplesi_FilePrefix == "") || (substr(strtolower($entry),0,strlen($simplesi_FilePrefix)) == strtolower($simplesi_FilePrefix))) {
    
    					$fcount++;
    					array_push($wd_fnames, $entry);
    					array_push($wd_ftypes, filetype($wd_path."/".$entry));
    //
    // simplesi change - insert filetime and filesize into new arrays
    //
    					array_push($simplesi_dates, filemtime($wd_path."/".$entry));
    					array_push($simplesi_sizes, filesize($wd_path."/".$entry));
    
    				}
    			}
    		}
    	}
    	$d->close();
    	$fcount--;
    
    	$wd_lowfnames = array_map('strtolower', $wd_fnames);
    
    //
    // simplesi change - change file sort order if needed
    //
    	$simplesi_Sort = $simplesi_Sort . "  ";
    	if (substr(strtolower($simplesi_Sort),0,1) == "d") {
    		if (substr(strtolower($simplesi_Sort),0,2) == "dd") {
    			array_multisort($simplesi_dates,SORT_DESC,$wd_ftypes, $wd_lowfnames, $wd_fnames);
    		}
    		else {
    			array_multisort($simplesi_dates,SORT_ASC,$wd_ftypes, $wd_lowfnames, $wd_fnames);
    		}
    	}
    	elseif (substr(strtolower($simplesi_Sort),0,1) == "s") {
    		if (substr(strtolower($simplesi_Sort),0,2) == "sd") {
    			array_multisort($simplesi_sizes,SORT_DESC,$wd_ftypes, $wd_lowfnames, $wd_fnames);
    		}
    		else {
    			array_multisort($simplesi_sizes,SORT_ASC,$wd_ftypes, $wd_lowfnames, $wd_fnames);
    		}
    	}
    
    	elseif ($simplesi_Sort == "  ") {
    		array_multisort($wd_ftypes, $wd_lowfnames, $wd_fnames);
    	}
    
    
    	$wd_http = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
    	$wd_http = substr($wd_http,0,strrpos($wd_http,'/')+1);
    	if (substr($wd_http,-4,4) == '/'.$sl.'/') $wd_http = substr($wd_http,0,strlen($wd_http)-3);
       
       if(eregi("true",$plugin_cf['wdir']['show_path'])) {
         $wdo .=  "<span class=\"wdPath\">"
            . "&nbsp;Path: <strong>" . $wd_http.$wd_PathParam. "&nbsp;</strong>"
            . "</span><br /> <br>\n";
       }
            
    	$wdo .= "<table>";
    	if(eregi("true",$plugin_cf['wdir']['show_colheader'])) {
    		$wdo .= "<tr>";
    		$wdo .= "<td colspan=\"3\" class=\"wdColHeader\">" . $plugin_tx['wdir']['txt_name'] . "</td>";
    		if(eregi("true",$plugin_cf['wdir']['show_size'])) 
    			$wdo .= "<td colspan=\"3\" class=\"wdColHeader\">" . $plugin_tx['wdir']['txt_size'] . "</td>";
    			
    		if(eregi("true",$plugin_cf['wdir']['show_changed'])) 
    			$wdo .= "<td class=\"wdColHeader\">" . $plugin_tx['wdir']['txt_changed'] . "</td>";
    			
    		if(eregi("true",$plugin_cf['wdir']['show_attributes'])) 
    			$wdo .= "<td colspan=\"2\" class=\"wdColHeader\">" . $plugin_tx['wdir']['txt_perms'] . "</td>";
    		
    		$wdo .= "</tr>";
    	}
       
       $wd_total = 0;
       for ($i = 0; $i <= $fcount; $i++) {
          $wd_fext = substr($wd_fnames[$i],strrpos($wd_fnames[$i],".")+1);
          //if (filetype($fullname) == "dir") $wd_fext = "DIR";
          $fullname = $wd_path . "/" . $wd_fnames[$i];
          if (filetype($fullname) == "dir") {
             /*
             $wdo .= "<tr>";
             $wd_fext = "DIR";
             $wdo .= "<td><img src=\"" . wd_FileIcon($wd_fext) . "\"></td><td></td>";
             $wdo .= "<td>". $wd_fnames[$i] . "</td><td>&nbsp;&nbsp;</td>";
             $wdo .= "<td></td><td>&nbsp;&nbsp;</td>";
             //$wdo .= "<td>Dateiordner</td><td>&nbsp;&nbsp;</td>";
             $wdo .= "<td>" . date("d.m.Y H:i:s", filemtime($fullname)) . "</td>";
             $wdo .= "</tr>\n";
             */
          } else {
             $wdo .= "<tr>";
             $wdo .= "<td><img src=\"" . wd_FileIcon($wd_fext) . "\"></td><td></td>";
             $wdo .= "<td><a href=\"" .$wd_http . $wd_PathParam .$wd_fnames[$i]. "\" target=\"" . $plugin_cf['wdir']['open_mode'] . "\">". $wd_fnames[$i] . "</a></td>";
             if(eregi("true",$plugin_cf['wdir']['show_size'])) 
             	$wdo .= "<td>&nbsp;&nbsp;</td><td align=\"right\">". number_format(filesize($fullname)/1024,0,',','.') . " KBytes</td><td>&nbsp;&nbsp;</td>";
             	
             $wd_total += filesize($fullname);
             //$wdo .= "<td>".strtoupper($wd_fext)."-Datei</td><td>&nbsp;&nbsp;</td>";
             if(eregi("true",$plugin_cf['wdir']['show_changed'])) 
             	$wdo .= "<td>" . date("d/m/Y", filemtime($fullname)) . "</td>";
             	
             if(eregi("true",$plugin_cf['wdir']['show_attributes'])) {
                //$wdo .= "<td></td><td>".decoct(fileperms($fullname))."</td>";
                $wdo .= "<td></td><td>".wd_FilePerms(decoct(fileperms($fullname)))."</td>";
             }
             
             $wdo .= "</tr>\n";
          }
       }
       $wdo .= "</table><br>";
       if(eregi("true",$plugin_cf['wdir']['show_summary'])) {
         $fcount++;
         $wdo .=  "<span class=\"wdSummary\">"
            . "&nbsp;" . $fcount . "&nbsp;" . $plugin_tx['wdir']['txt_files'] . ",&nbsp;" . number_format($wd_total,0,',','.') . "&nbsp;Bytes"
            . "</span><br /> <br>\n";
       }
    
       if(eregi("true",$plugin_cf['wdir']['show_creator'])) {
          $wdo .= "<div style=\"text-align: center; font-size: 0.75em; display: block\">";
       } else {
          $wdo .= "<div style=\"text-align: center; font-size: 0.75em; display: none\">";
       }
       $wdo .= "<br>&nbsp;<br><span style=\"border-top: 1px solid; padding-top: 2px; color:#666666;\">&nbsp;&nbsp;&nbsp;Webdirectory plugin, Ver. " . wd_version() . " by <a href=\"http://www.qualifire.de/cmsimple\" target=\"_blank\">QualiFIRE</a>&nbsp;&nbsp;&nbsp;</span>";
       $wdo .= "</div>";
    
       $wdo .= "<br></div>";
       $wdo .= "\n<!-- QualiFIREs WebDirectory >>WDir<< Code ends here -->\n";
       
       return $wdo;
    }
    
    
    
    function wd_FileIcon($wd_fext) {
    
    	GLOBAL $su, $sl, $plugin_cf, $plugin_tx, $pth, $plugin;
    
    	$wd_FullPath = $pth['folder']['plugins']."wdir/images/" . strtoupper($wd_fext) . "icon.gif";
    	if (!file_exists($wd_FullPath)) $wd_FullPath = $pth['folder']['plugins']."wdir/images/" . "UFO" . "icon.gif";
      
    	return $wd_FullPath;
    
    }
    
    
    function wd_FilePerms($fperms) {
    	$cRet = "<table><tr>";
    	for ($i=3; $i<=5; $i++) {
    		$cOctAcc = intval(substr($fperms,$i,1));
    		if ($cOctAcc-4 >= 0) {
    			$cOctAcc -= 4;
    			$cChrAcc = "<td class=\"wdFilePerms\">R</td>";
    		} else {
    			$cChrAcc = "<td class=\"wdFilePerms\">-</td>";
    		}
    		if ($cOctAcc-2 >= 0) {
    			$cOctAcc -= 2;
    			$cChrAcc .= "<td class=\"wdFilePerms\">W</td>";
    		} else {
    			$cChrAcc .= "<td class=\"wdFilePerms\">-</td>";
    		}
    		if ($cOctAcc == 1) {
    			//$cOctAcc -= 2;
    			$cChrAcc .= "<td class=\"wdFilePerms\">X</td>";
    		} else {
    			$cChrAcc .= "<td class=\"wdFilePerms\">-</td>";
    		}
    		
    		$cRet .= $cChrAcc;
    		$cRet .= "<td>&nbsp;</td>";
    	}
    	$cRet .= "</tr></table>";
    	return $cRet;
    }
    
    
    
    ?>

  7. Thanks to SimpleSi from:

    ninja-lewis (2nd June 2008)

  8. #5
    alonebfg's Avatar
    Join Date
    Aug 2006
    Location
    south west some of the time
    Posts
    834
    Thank Post
    12
    Thanked 34 Times in 21 Posts
    Blog Entries
    5
    Rep Power
    23
    there is a module in docman that will do that for you in joomla.

SHARE:
+ Post New Thread

Similar Threads

  1. Microsoft School Agreement Help Needed.
    By ICTNUT in forum Educational Software
    Replies: 6
    Last Post: 16th July 2009, 01:29 PM
  2. school server support contract needed
    By z4ydi in forum Network and Classroom Management
    Replies: 12
    Last Post: 3rd March 2008, 09:11 AM
  3. Sending HTML Newsletters
    By Simcfc73 in forum Web Development
    Replies: 13
    Last Post: 1st March 2007, 02:27 PM
  4. Replies: 6
    Last Post: 12th May 2006, 08:19 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •