There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Help with php coding


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
zeo's Avatar
zeo zeo is offline   zeo has a birthday soon!
Senior Member with 231 posts.
 
Join Date: Jan 2003
14-Nov-2003, 06:13 PM #1
Help with php coding
Could someone plz rip this code apart for me, i've tried expirmenting with it myself but kept coming up with errors.

its from a php mod called phpbb_fetch.

plz could someone rip the code into sections for me e.g.

Title - <?php for ($i = 0; $i < count($news); $i++) { ?> (dunno if it actually is)

So then i could jus copy and paste the codes into my site news layout then paste it into portal.php to i can use it on my index page using ssi.

Quote:
<!-- NEWS -->
<?php for ($i = 0; $i < count($news); $i++) { ?>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<th class="thTop" height="28"><?php echo $news[$i]['topic_title']; ?><?php if ($news[$i]['topic_trimmed']) { echo '...'; } ?></th>
</tr>
<tr>
<td class="row1" align="left" width="100%">
<span class="gensmall">
Posted by
<a href="<?php echo append_sid($phpbb_root_path . 'profile.php?mode=viewprofile&amp;u=' . $news[$i]['user_id']); ?>">
<?php echo $news[$i]['username']; ?>
</a>
on <?php echo $news[$i]['date']; ?> at <?php echo $news[$i]['time']; ?>
</span>
<span class="gen">
<hr size="1"/>
<?php echo $news[$i]['post_text']; ?><?php if ($news[$i]['trimmed']) { echo '...'; } ?>
</span>
<hr size="1"/>
<span class="gensmall">
<div align="right"><font color="#333333" face="Verdana" size="1">(<?php echo $news[$i]['topic_replies']; ?>)
<a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[$i]['topic_id']); ?>">
Comment<?php if ($news[$i]['topic_replies'] != 1) { echo 's'; } ?></a></font></div>
</span>
</td>
</tr>
</table>

<p />
<?php } ?>
<!-- NEWS -->
__________________
My main system:
Pentium D 945 3.4GHZ 2x2mb
MSI P965 Neo
1024MB DDR2 RAM
500GB WD SATA HD
ATI X1300 256MB PCI-E
LG CD/DVD/RW
LG DVD ROM
DAX SN450 PSU
XP PRO SP2

Secondary system:
Pentium D 805 2.66 GHz 2MB (1 Mb per Core)
ASRock 775DUAL-VSTA SKT 775 VIA PT880Pro/ultra
512MB DDR RAM
80GB Seagate barracuda 7200 IDE HD
NVIDIA FX5200 128MB AGP
LG CD/DVD/RW
Casecom Silver Mid-Tower
XP PRO SP1
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
14-Nov-2003, 06:24 PM #2
I have used phpBB fetch all before, what errors are you getting?
zeo's Avatar
zeo zeo is offline   zeo has a birthday soon!
Senior Member with 231 posts.
 
Join Date: Jan 2003
14-Nov-2003, 06:32 PM #3
not really errors with phpbb fetch itself, but trying to change the layout of the news template bit, but whenever paste my own layout into it and then move the bits over e.g. code that i think is the title and save it to see if it works i get an error saying error on line 266 etc...

what i'm really trying to do is replace the template for
Quote:
<!-- NEWS -->
<?php for ($i = 0; $i < count($news); $i++) { ?>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<th class="thTop" height="28"><?php echo $news[$i]['topic_title']; ?><?php if ($news[$i]['topic_trimmed']) { echo '...'; } ?></th>
</tr>
<tr>
<td class="row1" align="left" width="100%">
<span class="gensmall">
Posted by
<a href="<?php echo append_sid($phpbb_root_path . 'profile.php?mode=viewprofile&u=' . $news[$i]['user_id']); ?>">
<?php echo $news[$i]['username']; ?>
</a>
on <?php echo $news[$i]['date']; ?> at <?php echo $news[$i]['time']; ?>
</span>
<span class="gen">
<hr size="1"/>
<?php echo $news[$i]['post_text']; ?><?php if ($news[$i]['trimmed']) { echo '...'; } ?>
</span>
<hr size="1"/>
<span class="gensmall">
<div align="right"><font color="#333333" face="Verdana" size="1">(<?php echo $news[$i]['topic_replies']; ?> )
<a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[$i]['topic_id']); ?>">
Comment<?php if ($news[$i]['topic_replies'] != 1) { echo 's'; } ?></a></font></div>
</span>
</td>
</tr>
</table>

<p />
<?php } ?>
with my own template - keeping the codes so that they load up with my template.

Quote:
<!-- news updates starts -->

<table cellSpacing="0" cellPadding="0" width="542" border="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td>
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td width="10">
<img alt src="updatetop_b_1.gif" border="0" width="10" height="29"></td>
<td width="461" background="updatetop_b_2.gif" height="29">
<table cellSpacing="0" cellPadding="0" width="461" border="0">
<tr>
<td width="20">&nbsp;</td>
<td align="left" width="215"><font face="Arial,Helvetica" size="2">
Date</font></td>
<td align="middle" width="160"><b>
<font face="Arial,Helvetica" size="2" color="#FFFFFF">Title</font></b></td>
<td width="66">&nbsp;</td>
</tr>
</table>
</td>
<td align="middle" width="61" background="update_av_bg.gif" rowSpan="2">
<img height="45" src="zeo.gif" width="45" border="1"></td>
<td width="10" background="update_av_right.gif" height="63" rowSpan="2">&nbsp;</td>
</tr>
<tr>
<td vAlign="top" colSpan="2" height="34">
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td width="21" background="updateside_a.gif" height="34">&nbsp;</td>
<td vAlign="top" align="right" bgColor="#444444">
<font face="Arial,Helvetica" size="1"><font color="#000000">Posted
by:</font>
<font color="#FFFFFF">User</font>&nbsp;&nbsp;</font></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table cellSpacing="0" cellPadding="0" width="100%" bgColor="#444444" border="0">
<tr>
<td width="21" background="updateside_a.gif" height="100%">&nbsp;</td>
<td bgColor="#444444">
<table cellSpacing="0" cellPadding="4" width="100%" border="0">
<tr>
<td><font face="Arial,Helvetica" size="2" color="#FFFFFF">Blah blah
blah</font></td>
</tr>
</table>
</td>
<td width="12" background="updateside_b.gif" height="100%">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table cellSpacing="0" cellPadding="0" width="100%" bgColor="#444444" border="0">
<tr>
<td width="21" background="updateside_a.gif" height="100%">&nbsp;</td>
<td bgColor="#444444">
<table cellSpacing="0" cellPadding="4" width="100%" border="0">
<tr>
<td><b><font face="Verdana" size="1" color="#FFFFFF">Source:</font></b></td>
<td align="right">
<b>
<font face="Arial,Helvetica" size="2">&nbsp;</font></b></td>
</tr>
</table>
</td>
<td width="12" background="updateside_b.gif" height="100%">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="542" height="28">
<img alt src="updatebottom.gif" border="0" width="542" height="28"></td>
</tr>
</table>


<br>
I really jus need help with cutting the codes out of the fetch coding..

e.g. title would = <?php for ($i = 0; $i < count($news); $i++) { ?> etc, so if i were to paste it into my layout and save portal.php it would load up using my layout and the title in it. so it could b finally used in my index.html
__________________
My main system:
Pentium D 945 3.4GHZ 2x2mb
MSI P965 Neo
1024MB DDR2 RAM
500GB WD SATA HD
ATI X1300 256MB PCI-E
LG CD/DVD/RW
LG DVD ROM
DAX SN450 PSU
XP PRO SP2

Secondary system:
Pentium D 805 2.66 GHz 2MB (1 Mb per Core)
ASRock 775DUAL-VSTA SKT 775 VIA PT880Pro/ultra
512MB DDR RAM
80GB Seagate barracuda 7200 IDE HD
NVIDIA FX5200 128MB AGP
LG CD/DVD/RW
Casecom Silver Mid-Tower
XP PRO SP1
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
14-Nov-2003, 06:38 PM #4
Ok, I think I see what your saying now, but can you post the exact code that your using and what lines the errors are on.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:16 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.