News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Friends List Coding

Started by coldy316, November 30, 2009, 04:54:49 AM

Previous topic - Next topic

coldy316

Okay not sure where to put this but anyway here goes. this is a friends list that I was orignally using when
I was on smf version 1.1.10 now I'm using the smf version 2.0 RC2 default theme curve well that is standard
anyway..

what i would like to do is have the friends list in my board but keep getting errors when i put it in.. I would like
some one to redo the coding for me to get it working on smf 2.0Rc2 curve board.

Friends List Coding


<td class="titlebg" colspan="2">Our Friends: </td>
</tr>

<tr>
  <td class="windowbg" valign="middle" align="center"><img src="', $settings['images_url'], '/post/friends_www.gif" alt="Friends" /></td>
  <td class="windowbg2"><table width="100%" cellpadding="0" cellspacing="0">
  <tr>

    <td align="center" valign="top"><a href=" your link goes in here  " target="_blank" class="blogs"> name of site here  </a></td>
   
  </tr>
  <tr>
   
    <td align="center" valign="top" nowrap="nowrap"><a href=" your link goes in here  " title=" name of site here " target="_blank"> name of site here </a></td>

   
   
  </tr>
  <tr>
    <td align="center" valign="top"><a href="your link goes in here" target="_blank" class="blogs">name of site here</a></td>
   

  </tr>
  <tr>
   
  </tr>
  <tr>
    <td align="center" valign="top" nowrap="nowrap"> </td>
    <td align="center" valign="top" nowrap="nowrap"> </td>
    <td align="center" valign="top" nowrap="nowrap"> </td>
  </tr>
  <tr>
    <td align="center" valign="top" nowrap="nowrap"> </td>
    <td align="center" valign="top" nowrap="nowrap"> </td>
    <td align="center" valign="top" nowrap="nowrap"> </td>
  </tr>
</table></td>
  </tr>
  <tr>
    <td colspan="2" class="titlebg">Other Friends: </td>
  </tr>
<tr>
  <td class="windowbg" valign="middle" align="center"><img src="', $settings['images_url'], '/post/friends_www.gif" alt="Friends" /></td>
  <td class="windowbg2">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>

    <td align="center" valign="top"><a href="your link goes in here" target="_blank" class="blogs">name of site here</a></td>
   
  </tr>
  <tr>
   
    <td align="center" valign="top"> <a href="your link goes in here" target="_blank" class="blogs">name of site heree</a></td>
   
  </tr>
  <tr>
    <td align="center" valign="top"><a href="your link goes in here" target="_blank" class="blogs"> name of site here </a></td>
    <td align="center" valign="top"><a href="your link goes in here" target="_blank" class="blogs">name of site here </a></td>
   
   
  </tr>
  <tr>
   
  </tr>
  <tr>
    <td align="center" valign="top"> </td>
    <td align="center" valign="top"> </td>
  </tr>
</table></td>
  </tr>';
// Friends list ends here


thanks in advance if anyone can do it for me
Would you believe it that i live in gods country
Australia

Arantor


coldy316

Quote from: Arantor on November 30, 2009, 05:07:21 AM
So where do you want it?

It actually sits in the BoardIndex.template down in the info center above the recent posts
also thanks arantor..

One other thing is that when you add it in that section it says some parser error
Would you believe it that i live in gods country
Australia

Arantor

It gives you a parse error because the code you've posted is HTML, which doesn't work inside raw PHP without a proper echo statement.

Would you mind attaching the BoardIndex.template.php file you've edited please?

coldy316

Would you believe it that i live in gods country
Australia

Arantor

Even if I inserted that code it won't work properly because RC2 doesn't use tables the same way 1.1 does. Needs a rewrite entirely.

coldy316


  Is it possible of someone doing a rewrite of the code. it is a good friends list code it can also be use
  as an affiliate list as well.. do you know anyone that can do this within a week?
Would you believe it that i live in gods country
Australia

Nick Whetstone

#7
Doesn't look too great, but it doesn't cause errors and is in the spot you wanted it according to your post above.

In BoardIndex.template.php...
Find:

// This is the "Recent Posts" bar.


Replace with:
//Friends list
echo '
<dd class="titlebg" id="friends">Our Friends: </dd>
            </tr>
     
                        <dt id="friends">
              <dd class="windowbg" valign="middle" align="center" id="friends"><img src="', $settings['images_url'], '/post/friends_www.gif" alt="Friends" /></dd>
              <dd class="windowbg2"><dl width="100%" id="friends">
  <dt id="friends">

    <dd align="center" valign="top" id="friends"><a href=" your link goes in here  " target="_blank" class="blogs"> name of site here  </a></dd>
   
  </dt>
  <dt id="friends">
   
    <dd align="center" valign="top" nowrap="nowrap" id="friends"><a href=" your link goes in here  " title=" name of site here " target="_blank"> name of site here </a></dd>
   
   
   
  </dt>
  <dt id="friends">
    <dd align="center" valign="top" id="friends"><a href="your link goes in here" target="_blank" class="blogs">name of site here</a></dd>
   
   
  </dt>
  <dt id="friends">
   
  </dt>
  <dt id="friends">
    <dd align="center" valign="top" nowrap="nowrap" id="friends"> </dd>
    <dd align="center" valign="top" nowrap="nowrap" id="friends"> </dd>
    <dd align="center" valign="top" nowrap="nowrap" id="friends"> </dd>
  </dt>
  <dt id="friends">
    <dd align="center" valign="top" nowrap="nowrap" id="friends"> </dd>
    <dd align="center" valign="top" nowrap="nowrap" id="friends"> </dd>
    <dd align="center" valign="top" nowrap="nowrap" id="friends"> </dd>
  </dt>
</dl></dd>
  </dt>
  <dt id="friends">
                                                    <dd class="titlebg" id="friends">Other Friends: </dd>
  </dt>
                        <dt id="friends">
                          <dd class="windowbg" valign="middle" align="center" id="friends"><img src="', $settings['images_url'], '/post/friends_www.gif" alt="Friends" /></dd>
                          <dd class="windowbg2" id="friends">
<dl width="100%" style="border: none;" id="friends">
  <dt id="friends">

    <dd align="center" valign="top" id="friends"><a href="your link goes in here" target="_blank" class="blogs">name of site here</a></dd>
   
  </dt>
  <dt id="friends">
   
    <dd align="center" valign="top" id="friends"> <a href="your link goes in here" target="_blank" class="blogs">name of site here</a></dd>
   
  </dt>
  <dt id="friends">
    <dd align="center" valign="top" id="friends"><a href="your link goes in here" target="_blank" class="blogs"> name of site here </a></dd>
    <dd align="center" valign="top" id="friends"><a href="your link goes in here" target="_blank" class="blogs">name of site here </a></dd>
   
   
  </dt>
  <dt id="friends">
   
  </dt>
  <dt id="friends">
    <dd align="center" valign="top" id="friends"> </dd>
    <dd align="center" valign="top" id="friends"> </dd>
  </tr>
</dl></dd>
  </dt>';
// End friends list

// This is the "Recent Posts" bar.


Applied #friends to everything so you can re-format it in your CSS.
The artist formerly known as (Ha)²

Former Support Specialist

Please do not solicit support via PM. Here's why!

coldy316

so this will guarantee work on my board now?
Would you believe it that i live in gods country
Australia

coldy316

I have a small minor problem with it links are in line but going down
i need the links to be like this:

url site name               joe blow site               harrys site
freds site                      marys site                  doctor site

I have tried the center left and right alignment and it doesnt work

Would you believe it that i live in gods country
Australia

Arantor

Hmm, that coding style looks wrong to me; <dl> should be the main container, with <dt> and <dd> inside it, usually one <dd> for each <dt>

Also having multiple instances of the id all being the same is another reason it isn't valid XHTML.

* Arantor will try and look at this in a bit, but no promises.

coldy316

Quote from: Arantor on December 01, 2009, 03:30:22 AM
Hmm, that coding style looks wrong to me; <dl> should be the main container, with <dt> and <dd> inside it, usually one <dd> for each <dt>

Also having multiple instances of the id all being the same is another reason it isn't valid XHTML.

* Arantor will try and look at this in a bit, but no promises.


Thank you so much arantor for helping me out on this, I really do appreciate it...

If there was areputation system in here I would give you a hundred points
Would you believe it that i live in gods country
Australia

Nick Whetstone

#12
Quote from: Arantor on December 01, 2009, 03:30:22 AM
Hmm, that coding style looks wrong to me; <dl> should be the main container, with <dt> and <dd> inside it, usually one <dd> for each <dt>

Also having multiple instances of the id all being the same is another reason it isn't valid XHTML.

* Arantor will try and look at this in a bit, but no promises.

You very well may be right, as I was in a hurry when I re-coded this... Basically, I just redid the table, tr, td and replaced them with the dl, dt, dd. I'm working on coding it better now, and using classes instead of IDs.

EDIT: Since he wants 3 per row, would it be easier to use the tables? Or are tables pretty much ruled out except for the main one in 2.0?
The artist formerly known as (Ha)²

Former Support Specialist

Please do not solicit support via PM. Here's why!

Nick Whetstone

Quote from: coldy316 on November 30, 2009, 11:42:24 PM
I have a small minor problem with it links are in line but going down
i need the links to be like this:

url site name               joe blow site               harrys site
freds site                      marys site                  doctor site

I have tried the center left and right alignment and it doesnt work



So, you want them to be 3 per row, all centered?
The artist formerly known as (Ha)²

Former Support Specialist

Please do not solicit support via PM. Here's why!

SISPro

Now i really like this ideal and what it is for. Now i have used the code at the top but see that it still needs work done on it has anyone tried to re work this out yet

thank you for your support here on this.


Nick Whetstone

So far I have gotten rid of the horrid indention that was previously there.
Waiting to hear back from Arantor about the tables before I go any further, as that may be the best way to go.
The artist formerly known as (Ha)²

Former Support Specialist

Please do not solicit support via PM. Here's why!

Arantor

No need to wait for me here!

Use whatever works best. It isn't tabular data so a table wouldn't be the first port of call IMO, but just because Curve itself steers away from tables doesn't mean you can't use them - just the overall layout relied on them originally.

Tell you what I'd personally do, and what I did for a mod recently, though I learned it wasn't the "most efficient" method.

Encapsulate the friends area in a div, id friends, then each column as an unordered list, with style "list-style: none; display:block; width:33%; float:left;" which will get you 3 columns that sit next to each other. I think you can then use text-align:center; to centralise them.

coldy316

thanks guys for the update on this much appreciate it
Would you believe it that i live in gods country
Australia

coldy316

Its meant to sit like this but the blogs and others are meant to have three rows as well
click on the attach image to view
Would you believe it that i live in gods country
Australia

SISPro

can't wait to get this mod need it for my site to have friends on it.

Advertisement: