Warning Nu esti autentificat. Te rog autentifica-te sau inregistreaza-te pentru a avea acces la toate facilitatile forumului.
SkullBox  
Noiembrie 23, 2008, 03:07:11 pm
Bine ai venit, Vizitator. Trebuie să te autentifici sau să îţi creezi un cont.
Ai pierdut sau nu ai primit emailul care conţine codul de activare al contului?

Autentifică-te cu numele de utilizator, parola şi precizează durata sesiunii.
Noutăţi: SmLex DeviantART
 
 SkullBoxDirector webTutoriale  Pagina principală   Ajutor Caută Autentificare Creează un cont  
Pagini: [1]
  Imprimă  
Subiect: Website Forum Post  (Citit de 622 ori)
0Utilizatori şi 1 Vizitatori
zapakitul
Global Moderator
Hero Member
*****
Deconectat Deconectat

Mesaje: 1417



Website Forum Post, Noiembrie 27, 2007, 10:08:09 pm

Am neovie de un snippet sau ceva, care sa afiseze pe site ultimele posturi de pe forum!
Memorat

A DS , my kindom for a  DS!

Un Pc De Carcasa Noua Blog
emj
Sr. Member
****
Deconectat Deconectat

Mesaje: 454



WWW
Website Forum Post, Noiembrie 27, 2007, 10:43:35 pm

Uite aici..trebuie sa modiifci decat urlpath si serverpath,,si il pui pe site sau unde vrei..
Cod:
<?php 
/**
* Mod Title:   Latest posts/topics
* Mod Version: phpBB 2.0
* Author:      Pegas (pegas@ami.cz) (originally made by ?, previous version by LiLCoolboy (M@urice Cheung))
* Description: Shows latest posts or topics on any page, 2 optional parameters
* Release:     v3.0, 27.01.2003
***
* DeMo:                http://kocky-online.cz (Czech language) 
* Installation Level:  Easy 
* Installation Time:   5 minutes 
* Files To Edit:       0 
* Included Files:      (if necessary) 
***
* Installation Notes:
* Put this code into new file, set $serverPath and $urlPath, 
* upload this file onto server and include into your page and you are done!
*   -- OR --
* Put this code into your page, set $serverPath and $urlPath, 
* and you are done!
***
* Parameters:
* There are 2 optional parameters when calling this code as standalone file via include!
* type - whether to show topics or posts
*   type=posts  - posts [default when missing]
*   type=topics - topics
* count - how much posts/topics show
*   count=# [default is 3]
***
* Examples (assume that your file with this code is hilites.php):
* hilites.php?type=topics&count=5
*  - shows latest 5 topics
* hilites.php?type=topics
*  - shows latest 3 topics
* hilites.php
*  - shows latest 3 posts
***
* Revision:
* v1.0 
*  author: ?
* v2.0
*  author: LiLCoolboy (M@urice Cheung) 
*  - not working without significant changes, mistypes
* v3.0
*  author: Petr Gasparik
*  + added parameters when called as standalone file
*  + posts/topics selection corrected
*  + corrected mistypes
*/
$urlPath "/forum"; //example: if your forum URL looks like http://kocky-online.cz/forum, this should be "/forum"
$serverPath "/config.php"; //example: when this file is in URL path /forum/mod, this should be ../config.php
if(empty($count))
$count "3"; //default value of how many posts/topics to show
if(empty($type))
$type "posts"; //default value of whether to show 'posts' or 'topics' 
$titleLimit 30; //this is max.length of 'title' of topic/post
$moreLimit 20; //this is max.length of 'more' (used in posts)

//-----------------[ DO NOT EDIT BELOW HERE ]------------------------- 
include_once("$serverPath"); 
$db = @mysql_connect("$dbhost""$dbuser""$dbpasswd") or die("here we die at connection"); 
@
mysql_select_db("$dbname",$db) or die("here we die"); 

if(
$type == "posts"
{
$prefix 'p';
   
$sql "SELECT x.post_subject as title, p.post_id as id, f.forum_id, t.topic_title as more "
   
."FROM ${table_prefix}topics t, ${table_prefix}forums f, ${table_prefix}posts p, ${table_prefix}posts_text x "
   
."WHERE t.topic_id = p.topic_id AND f.forum_id = t.forum_id AND p.post_id = x.post_id "
   
."ORDER BY p.post_id DESC "
   
."LIMIT $count"
}
else 
{
$prefix 't';
   
$sql "SELECT t.topic_title as title, t.topic_id as id, f.forum_id, '' as more "
   
."FROM ${table_prefix}topics t, ${table_prefix}forums f "
   
."WHERE f.forum_id = t.forum_id "
   
."ORDER BY topic_time DESC "
   
."LIMIT $count"
}

//echo $sql;

if($r mysql_query($sql$db)) { 
while($m mysql_fetch_array($r)) { 
$j stripslashes($m[title]); 
$k substr($j0$titleLimit) . "..."
if(!empty($m[more]))
$m[more] = '('.substr($m[more], 0$moreLimit) . '...)'
if ($type == 'posts') {
$anchor '#'.$m[id];
}
//-------------------[ THIS IS ONLY LINE YOU COULD CHANGE ]--------------------------
echo "<a title=\"$m[title]\" href=\"$urlPath/viewtopic.php?${prefix}=$m[id]&sid=$m[forum_id]${anchor}\">$k</a> $m[more]
"



}
//-------------------[ DO NOT EDIT UP HERE ]--------------------------
?>
Memorat

Gadgetinho - IT cu zambetul pe buze
Mondenitati - Discutii cu si despre muzica si cinematografie... si monden.
zapakitul
Global Moderator
Hero Member
*****
Deconectat Deconectat

Mesaje: 1417



Website Forum Post, Noiembrie 28, 2007, 07:25:29 am

thankx dude !
Memorat

A DS , my kindom for a  DS!

Un Pc De Carcasa Noua Blog
zapakitul
Global Moderator
Hero Member
*****
Deconectat Deconectat

Mesaje: 1417



Website Forum Post, Noiembrie 28, 2007, 07:58:11 am

Ciudat imi da o eroare:
Cod:
Parse error: syntax error, unexpected '}' in /storage0/home/games4ever.evonet.ro/zap-net.org/concurs.zap-net.org/www/post.php on line 98
Fisierul lam numit post.php si de modificat nu am ce sa modific, forumul este cum zice acolo si am lasat /forum iar /config.php tot asa a ramas!
Memorat

A DS , my kindom for a  DS!

Un Pc De Carcasa Noua Blog
Agkelos
Administrator
Hero Member
*****
Deconectat Deconectat

Gen: Bărbat
Mesaje: 4758



WWW
Website Forum Post, Noiembrie 28, 2007, 08:25:05 am

Nu am testat codul dar la o numaratoare rapida intr-adevar se pare ca e o acolada in plus Big grin

Sterge ultima acolada si trebuie sa mearga.
Memorat


zapakitul
Global Moderator
Hero Member
*****
Deconectat Deconectat

Mesaje: 1417



Website Forum Post, Noiembrie 28, 2007, 09:07:12 am

Neh nui de la aia,... am sterso! Si nu apare nimik.. am incercat sa psotez pe forum! Am pus chiar manual variabilele de host database user si password si in final nu mai mia dat eroare... in schimb... nu imi afiseaza nimik!
Memorat

A DS , my kindom for a  DS!

Un Pc De Carcasa Noua Blog
Agkelos
Administrator
Hero Member
*****
Deconectat Deconectat

Gen: Bărbat
Mesaje: 4758



WWW
Website Forum Post, Noiembrie 28, 2007, 09:21:19 am

Probabil nu-ti afiseaza nimic pentru ca nu e setat sa iti afiseze erorile. Sterge semnul @ din fata functiilor, pune in .htaccess urmatoarele doua linii si vezi ce zice:

Cod:
php_flag display_errors on
php_value error_reporting 7
Memorat


zapakitul
Global Moderator
Hero Member
*****
Deconectat Deconectat

Mesaje: 1417



Website Forum Post, Noiembrie 28, 2007, 09:41:12 am

nam .htaccess nicaieri! Am incercat sa i lcreez dar da internel server eror Straight face
Memorat

A DS , my kindom for a  DS!

Un Pc De Carcasa Noua Blog
Agkelos
Administrator
Hero Member
*****
Deconectat Deconectat

Gen: Bărbat
Mesaje: 4758



WWW
Website Forum Post, Noiembrie 28, 2007, 11:00:16 am

Atunci seteaza ariabilele cu ini_set().
Memorat


HostGator
Newbie
*
Mesaje: Multe

Reclamă cu aligatori
 

Ai auzit de aligatorul care ofera hosting?
 
   
Pagini: [1]
  Imprimă  
 
Schimbă forumul:  

Creat cu MySQL Creat cu PHP Ethical hacking and programming community Director web romanesc cu inscriere gratuita Validat cu XHTML 1.0! Validat cu CSS!
IPFind, FAQDB, LAMP.ro, Good Proxy, Aberez.EU, RoFreeSBIE, ShockingSoft.com, HostVision, Invatam.net, PC Troubleshooting, Curs valutar online
Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
Traducerea în limba română © 2006-2007 www.smf.ro