Forums de GTA Légende

Système de news grace a phpBB3

Un soucis en informatique ? Bloqué dans un jeux ? Ou tout simplement envie de parler informatique ? Ce forum est fait pour vous !

Système de news grace a phpBB3

Messagede s.devil le 11 Avr 2008, 13:35

Bonjour
Je cherche un script pour afficher les news de phpBB3 sur son site, Ces news seraient enregistrés dans une rubrique du forum et doivent être affiché sur la page d'accueil de mon site.

Structure :
Nom du post
Message
Posté par [] le [DATE] à [HEURE] - [] Commentaires ( exactement comme celui sur la page d'accueil )

J'espère quel ElPatron me donne son script :D

Merci d'avance.
s.devil
Newbie
 
Messages: 1
Inscription: 18 Mar 2008, 23:02

Re: Système de news grace a phpBB3

Messagede El Patron le 12 Avr 2008, 12:48

Ouais, ça fera 20€...


Nan j'déconne. J'voudrais bien te passer le miens mais je l'ai un peu trop personnalisé et c'est un peu le fouillis dans le code, alors je vais te filer un lien où je l'ai téléchargé.

Attention, c'est pour la version PHPBB2, donc les noms des tables ne sont pas les mêmes, et il faut modifier pas mal de choses : http://www.comscripts.com/scripts/php.p ... .2284.html


Bonne chance !
El Patron, webmaster de GTA Légende
Avatar de l’utilisateur
El Patron
Administrateur
 
Messages: 3721
Inscription: 24 Déc 2007, 10:21
Localisation: Paris

Re: Système de news grace a phpBB3

Messagede Yanover le 12 Avr 2008, 18:05

El Patron a écrit:Ouais, ça fera 20€...


Mdr on fais des affaire ici a parement !^

Bonne chance Devil
Image
Avatar de l’utilisateur
Yanover
Modérateur
 
Messages: 1179
Inscription: 25 Jan 2008, 09:50
Localisation: Liberty City

Re: Système de news grace a phpBB3

Messagede s.devil le 13 Avr 2008, 10:52

bonjour
elpatron voila le script que j'ai :
Code: Tout sélectionner
<?php

define('IN_PHPBB', true);
define('IN_SITE', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : 'phpBB3/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);

// Start session management
// $user->session_begin();
// $auth->acl($user->data);
// $user->setup('viewtopic', 0);

$host = 'localhost';
$user = 'root';  //nom d'utilisateur
$pass = ''; //mot de pass
$bdd = 'phpBB3'; // votre base de donnée

mysql_connect($host, $user, $pass);
mysql_select_db($bdd) or die('Impossible de se connecter');

function obtain_word_list()
{
   global $config, $user, $db;

   $sql = 'SELECT word, replacement FROM ' . WORDS_TABLE;
   $result = $db->sql_query($sql);

   $censors = array();
   while ($row = $db->sql_fetchrow($result))
   {
      $censors['match'][] = '#(?<!\w)(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')(?!\w)#i';
      $censors['replace'][] = $row['replacement'];
   }
   $db->sql_freeresult($result);

   return $censors;
}

function smiley_msg($text)
{
   global $config, $phpbb_root_path;
   return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img src="' . $phpbb_root_path . $config['smilies_path'] . '/\2 />', $text);
}

function nl2br_msg($text)
{
      $text = str_replace(array("\n", "\r"), array('<br clear="all"/>', "\n"), $text);
      return $text;
}

function censor_msg($text)
{
   if (!isset($censors) || !is_array($censors))
   {
      $censors = obtain_word_list();
   }

   if (sizeof($censors))
   {
      return preg_replace($censors['match'], $censors['replace'], $text);
   }

      return $text;
}

$table_prefix = 'forums_';
$sql = "SELECT p.*, t.topic_replies, t.topic_first_poster_name
FROM forums_posts p, forums_forums f, forums_topics t
WHERE f.forum_id=2
AND p.topic_id = t.topic_id
AND p.forum_id = f.forum_id
AND f.forum_id = t.forum_id
AND p.post_id = t.topic_first_post_id
ORDER BY topic_time DESC";
$req = mysql_query($sql);

//Initialisation de la variable "qui compte les news"
$j = 1;

// Instantiate BBCode if need be
if ($bbcode_bitfield !== '')
{
   $bbcode = new bbcode(base64_encode($bbcode_bitfield));
}

while($data = @mysql_fetch_array($req))
{
   $subject = $data['post_subject'];
   $subject = censor_msg($subject);
   $subject = smiley_msg($subject);

   //Affichage du titre
   echo '<div class="entry"><h1>'.$subject.'</h1>';

   $message = $data['post_text'];
   $message = censor_msg($message);

   if ($data['bbcode_bitfield'])
   {
      $bbcode->bbcode_second_pass($message, $data['bbcode_uid'], $data['bbcode_bitfield']);
   }

   $message = nl2br_msg($message);
   $message = smiley_msg($message);



   //Affichage du contenu de la news
   echo '<div class="text">'.$message.'</div>';
   // if ($ok!=1)  echo '<p class="titre">'.$message.'</p>';

   //Affichage de l'auteur
   echo '<div class="source">Post&eacute; par <a href="'.$phpbb_root_path.'memberlist.php?mode=viewprofile&u='.$data['poster_id'].'">'.(strtolower($data['topic_first_poster_name'])) .'</a> le '.date('d/m/y à H\hi', $data['post_time']).' - ';

   //Des commentaires
   echo '<a href="'.$phpbb_root_path.'viewtopic.php?t='.$data['topic_id'].'"> '.$data['topic_replies'].' commentaire(s)</a></div></div>';
   $ok=2;
   //Si on atteints 5 news, on arrête
   if($j >= 5)
   {
      break;
   }
       $j++;
}
@mysql_free_result($req);
?>



et j'ai fai une modification du fichié bbcode.php
Code: Tout sélectionner
TROUVER
$this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/bbcode.html';

REMPLACER PAR
if (!IN_SITE)
{
$this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/bbcode.html';
}
else
{
$this->template_filename = $phpbb_root_path . 'styles/prosilver/template/bbcode.html';
}

TROUVER

if ($user->optionget('viewimg'))
{
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[img:$uid\](.*?)\[/img:$uid\]#s' => $this->bbcode_tpl('img', $bbcode_id),
)
);
}
else
{
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[img:$uid\](.*?)\[/img:$uid\]#s' => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id, true)),
)
);
}

REMPLACER PAR

if (!IN_SITE)
{
if ($user->optionget('viewimg'))
{
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[img:$uid\](.*?)\[/img:$uid\]#s' => $this->bbcode_tpl('img', $bbcode_id),
)
);
}
else
{
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[img:$uid\](.*?)\[/img:$uid\]#s' => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id, true)),
)
);
}
}
else
{
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[img:$uid\](.*?)\[/img:$uid\]#s' => $this->bbcode_tpl('img', $bbcode_id),
)
);
}

TROUVER
if ($user->optionget('viewflash'))
{
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => $this->bbcode_tpl('flash', $bbcode_id),
)
);
}
else
{
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => str_replace('$1', '$3', str_replace('$2', '[ flash ]', $this->bbcode_tpl('url', $bbcode_id, true)))
)
);
}

REMPLACER PAR
if (!IN_SITE)
{
if ($user->optionget('viewflash'))
{
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => $this->bbcode_tpl('flash', $bbcode_id),
)
);
}
else
{
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => str_replace('$1', '$3', str_replace('$2', '[ flash ]', $this->bbcode_tpl('url', $bbcode_id, true)))
)
);
}
}
else
{
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => $this->bbcode_tpl('flash', $bbcode_id),
)
);
}


le probléme c'est quand je post un message avec des lien,sa ne s'affiche pas sur la page d'accueil.
s.devil
Newbie
 
Messages: 1
Inscription: 18 Mar 2008, 23:02

Re: Système de news grace a phpBB3

Messagede GregoryDreaf le 12 Avr 2023, 10:34

GregoryDreaf
Homme de main
 
Messages: 177655
Inscription: 25 Nov 2022, 18:54
Localisation: Zambia

Re: Système de news grace a phpBB3

Messagede GregoryDreaf le 03 Mai 2023, 02:36

audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.rusemiasphalticflux.rusemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoning.rutechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.rutemperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru
GregoryDreaf
Homme de main
 
Messages: 177655
Inscription: 25 Nov 2022, 18:54
Localisation: Zambia


Re: Système de news grace a phpBB3

Messagede GregoryDreaf le 11 Sep 2023, 04:51

GregoryDreaf
Homme de main
 
Messages: 177655
Inscription: 25 Nov 2022, 18:54
Localisation: Zambia

Re: Système de news grace a phpBB3

Messagede GregoryDreaf le 03 Oct 2023, 05:25

audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboardgagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatormagnetotelluricfieldmailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffusersemiasphalticfluxsemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchucktaskreasoningtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimatetemperedmeasuretenementbuildingtuchkasultramaficrockultraviolettesting
GregoryDreaf
Homme de main
 
Messages: 177655
Inscription: 25 Nov 2022, 18:54
Localisation: Zambia

Re: Système de news grace a phpBB3

Messagede GregoryDreaf le 03 Déc 2023, 07:50

GregoryDreaf
Homme de main
 
Messages: 177655
Inscription: 25 Nov 2022, 18:54
Localisation: Zambia

Re: Système de news grace a phpBB3

Messagede GregoryDreaf le 03 Jan 2024, 08:47

инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинйоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоtuchkasинфоинфо
GregoryDreaf
Homme de main
 
Messages: 177655
Inscription: 25 Nov 2022, 18:54
Localisation: Zambia


Retourner vers Informatique et Jeux Vidéos

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 2 invités