Gå til innhold

news script


Anbefalte innlegg

hmm.. ok.. her er jeg igjen.. :wow:

 

 

 

Jeg trenger å lage meg noe php greier..

det der er snakk om, er en nyhetside.

Den siste datoen på nyheten skal bli vist i div som går igjen på alle sider.

Det spiller ingen rolle om jeg må skrive inn nyheten automatisk så lenge div'en-som-går-igjen blir opdatert automatisk.

 

noen tips og hint om hvor jeg starter?

kanskje det finnes noen ferdiglaget scripst for dette?

Lenke til kommentar
Videoannonse
Annonse

du må ha et ftp program som lar deg CHMOD'e mapper/filer. til det bruker jeg smartftp. du høyreklikker på mappen/filen på serveren du vil CHMOD'e. du setter denne til 777 eller klikker av på write read execute på alle radene bortover. dette vil si at du kan skrive inn nyheten din på "admin" siden så skriver scriptet dette til "artikkel" filen. for at dette skal vøre mulig må CHMOD'e..

 

du må gjøre dette på hele mappen som artikkelscriptet ligger i.

Endret av Smidt
Lenke til kommentar

selvfølgelig må scriptene ligge på serveren.

du kan lage mappen på din egen maskin, spiller ingen rolle hvor den blir laget så lenge en mappe som er CHMOD'et med scriptene ligger på serveren din. du må du må også CHMOD'e alle filer som skal skrives til, dvs alle filer som skal vise artiklene, (sammendrag osv.)

Lenke til kommentar
1. Please make sure that your const.inc.php and /photo/ is writable.

2. Run /admin/install.php. Set database username and password, delete install.php and installfinish.php.

3. /admin/ is the admin program. You can rename it for the sake of security.

 

ok.. nr.1. Jeg la filene i en ftp mappe på min PC. (mappen er delt me 100% tilgang.) jeg fant frem til

include("../const.inc.php");
if (!(is_writeable("../const.inc.php")))

så skrev jeg inn

include("ftp://house:[email protected]/const.inc.php");
if (!(is_writeableftp://house:[email protected]/const.inc.php")))

 

får meldingen

Warning: main(ftp://[email protected]/const.inc.php): failed to open stream: FTP server reports 550 Command failed: Format '%d' invalid or incompatible with argument. in /home/housemaa/public_html/PHP/en/admin/install.php on line 2

 

Warning: main(): Failed opening 'ftp://[email protected]/const.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/housemaa/public_html/PHP/en/admin/install.php on line 2

Lenke til kommentar

Jeg legger til lit mer info...

 

 

Read Me.txt
...Before you install this system, please make sure that you have php and mysql installed.
1. Please make sure that your const.inc.php and /photo/ is writable. 
2. Run /admin/install.php. Set database username and password, delete install.php and installfinish.php.
3. /admin/ is the admin program. You can rename it for the sake of security.....

 

install.php
<?php
include("../const.inc.php");
if (!(is_writeable("../const.inc.php"))){
print "$admin_constisnotwriteable";
exit;
}
?>
<html>
<head>
<title><?php print "$admin_install"; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php print "$admin_charset"; ?>">
<link rel="stylesheet" href="style/style.css" type="text/css">
</head>

<body bgcolor="#FFFFFF">
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<form action="installfinish.php" method="POST">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
 <tr> 
   <td align="center" valign="top"> 
     <hr width="90%" size="1" noshade>
     <table width="90%" border="0" cellspacing="0" cellpadding="4" height="300">
       <tr> 
         <td align="center"> 
           <p><?php print "$admin_databasesetting"; ?></p>
           <table width="300" border="0" cellspacing="1" cellpadding="4" bgcolor="#F2F2F2">
             <tr bgcolor="#FFFFFF"> 
               <td width="83"><?php print "$admin_databasename"; ?> :</td>
               <td width="198"><input type="text" name="installdbname" value="dingyetest"></td>
             </tr>
             <tr bgcolor="#FFFFFF"> 
               <td><?php print "$admin_databaseuser"; ?> :</td>
               <td><input type="text" name="installdbuser" value="root"></td>
             </tr>
             <tr bgcolor="#FFFFFF"> 
               <td><?php print "$admin_databasepass"; ?> :</td>
               <td><input type="text" name="installdbpass"></td>
             </tr>
             <tr bgcolor="#FFFFFF"> 
               <td><?php print "$admin_databasehost"; ?> :</td>
               <td><input type="text" name="installdbhost" value="localhost"></td>
             </tr>
             <tr bgcolor="#FFFFFF"> 
               <td colspan="2"><br><p><?php print "$admin_setadminpassword"; ?></p></td>                
             </tr>
             <tr bgcolor="#FFFFFF"> 
               <td><?php print "$admin_username"; ?> :</td>
               <td><input type="text" name="installusername" value="dingye"></td>
             </tr>
             <tr bgcolor="#FFFFFF"> 
               <td><?php print "$admin_password"; ?> :</td>
               <td><input type="text" name="installpassword" value="test"></td>
             </tr>
             <tr bgcolor="#FFFFFF"> 
               <td><?php print "$admin_adminemail"; ?> :</td>
               <td><input type="text" name="installadminemail"></td>
             </tr>
             <tr bgcolor="#FFFFFF"> 
               <td> </td>
               <td><input type="submit" name="Submit" value="<?php print "$admin_next"; ?>"></td>
             </tr>
           </table>
         </td>
       </tr>
     </table>
     
   </td>
 </tr>
 <tr>
   <td align="center" valign="top" height="40"> </td>
 </tr>
</table>
</form>
<?php
include("bottom.php3");
?>
</body>
</html>

const.inc.php
<?php

//Database settings

$DBName = "dingyenews";
$DBUser = "root";
$DBPassword = "";
$DBHost = "localhost";
$adminemail = "";

//Front Language settings
$front_charset = "iso-8859-1";
$front_previouspage = "Previous page";
$front_nextpage = "Next page";
$front_submititle = "Title";
$front_categories = "Categories";
$front_indextitle = "Index";
$front_searchresult = "Search result";
$front_searchsubmit = "Search";
$front_latestnews = "Latest news";
$front_more = "More";
$front_rateit = "Rate it";
$front_rating = "Rating";
$front_letmerateit = "Let me rate it";
$front_ratebest = "best";
$front_ratesubmit = "Rate!";
$front_adddate = "Date of this item added";
$front_source = "Source of this article";

$front_latestonhomerecord = 10;
$front_latestoncatarecord = 20;
$front_searchresultrecord = 20;
$front_catnewsonhomerecord = 5;
$front_catnewsoncatarecord = 5;

//Admin Language settings
$admin_charset = "iso-8859-1";
$admin_url = "URL";
$admin_ok = "OK";
$admin_back = "Back";
$admin_add = "Add";
$admin_name = "Name";
$admin_del = "Del";
$admin_previouspage = "Previous page";
$admin_nextpage = "Next page";
$admin_news = "News";
$admin_delconfirm = "Really want to delete it?";
$admin_yes = "Yes";
$admin_no = "No";
$admin_edit = "Edit";
$admin_adminindex = "Admin index";
$admin_next = "Next";
$admin_reset = "Reset";
$admin_description = "Description";
$admin_adminsystem = "Admin system";
$admin_admin = "Admin";
$admin_welcome = "Welcome to admin system";
$admin_existing = "Existing";
$admin_opreation = "Opreation";
$admin_save = "Save";
$admin_picture = "Picture";
$admin_install = "install";
$admin_databasename = "Database Name";
$admin_databaseuser = "Database User";
$admin_databasepass = "Database Password";
$admin_databasehost = "Database Host";
$admin_adminemail = "Admin Email";
$admin_databasesetting = "Database setting";
$admin_setadminpassword = "Please choose username and password for administrator";
$admin_username = "username";
$admin_password = "password";
$admin_loginfail = "Wrong username or password";
$admin_login = "log in";
$admin_linkadded = "link added";
$admin_constisnotwriteable = "const.inc.php is not writeable,please change its permission";
$admin_catalogadmin = "Category admin";
$admin_newsadmin = "News admin";
$admin_parentcatalog = "Parent category";
$admin_catalogalreadyexist = "Category already exist";
$admin_catalog = "Category";
$admin_isdisplay = "Is displayed?";
$admin_none = "none";
$admin_title = "Title";
$admin_content = "Content";
$admin_viewnumber = "Hits";
$admin_rating = "Rating";
$admin_ratenumber = "Rate number";
$admin_source = "Source";
$admin_sourceurl = "Source URL";

$help_source = "If your text is from other source.";
?>

Lenke til kommentar
Er du sikker på at den ligger på en side som kun støtter FTP? Hvis du heller peker den til hjemmesiden din, vil nok noe av problemene være løst.

resulate av det er:

Warning: main(): stream does not support seeking in

/home/housemaa/public_html/PHP/en/admin/install.php on line 2

Lenke til kommentar
jeg fant frem til
include("../const.inc.php");
if (!(is_writeable("../const.inc.php")))

så skrev jeg inn

include("ftp://house:[email protected]/const.inc.php");
if (!(is_writeableftp://house:[email protected]/const.inc.php")))

Skal du endre koden der i det hele tatt, da? Tror ikke akkurat det. Forøvrig har du gjort endel syntaksfeil der. (tenker ikke på det at du skrev inn FTP-adressen istedenfor HTTP)

Lenke til kommentar

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
  • Hvem er aktive   0 medlemmer

    • Ingen innloggede medlemmer aktive
×
×
  • Opprett ny...