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.

Arantor

SISPro: it's not a mod. It's just discuss how to edit the files; I doubt it will be packaged as a mod, and even if it were, on 1.1 you'd likely have to install it yourself anyway.

coldy316

Quote from: Arantor on December 04, 2009, 03:35:55 AM
SISPro: it's not a mod. It's just discuss how to edit the files; I doubt it will be packaged as a mod, and even if it were, on 1.1 you'd likely have to install it yourself anyway.

Could this be turn into a mod arantor???
Would you believe it that i live in gods country
Australia

Nick Whetstone

Ahh... I absolutely fail :P I completely forgot to finish this. It was a crazy week (hosted a 250+ people party, went out of state for the weekend, etc...).

I shall work on this tomorrow. Once again, I apologize.
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 December 09, 2009, 12:20:16 AM
Could this be turn into a mod arantor???
Yes, it could. It could take a little more time, but it could have more features, such as possibly the ability to customize it and its contents from the Admin panel, the option to enable/disable it from the Admin panel without fully uninstalling it, etc...
Will you want just the code or a Mod for it? Need to know before I start working on it tomorrow.
The artist formerly known as (Ha)²

Former Support Specialist

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

Arantor

Quote from: coldy316 on December 09, 2009, 12:20:16 AM
Could this be turn into a mod arantor???

Please read what I said;
Quoteand even if it were, on 1.1 you'd likely have to install it yourself anyway.

coldy316

Quote from: crazysince95 on December 09, 2009, 01:16:36 AM
Quote from: coldy316 on December 09, 2009, 12:20:16 AM
Could this be turn into a mod arantor???
Yes, it could. It could take a little more time, but it could have more features, such as possibly the ability to customize it and its contents from the Admin panel, the option to enable/disable it from the Admin panel without fully uninstalling it, etc...
Will you want just the code or a Mod for it? Need to know before I start working on it tomorrow.

The code would be great thanks crazysince95.

arantor it was just a question thats all, your post got me confuse.
Would you believe it that i live in gods country
Australia

Arantor

Simple fact: most mods on 1.1 have to be installed manually on custom themes, it's all down to what the mod modifies and what files the theme uses.

Here is a modification to BoardIndex.template.php - many mods do include their own so you'd have to make it a manual modification even if it were published as a mod.

coldy316

Quote from: Arantor on December 09, 2009, 08:33:32 AM
Simple fact: most mods on 1.1 have to be installed manually on custom themes, it's all down to what the mod modifies and what files the theme uses.

Here is a modification to BoardIndex.template.php - many mods do include their own so you'd have to make it a manual modification even if it were published as a mod.

Hey thats cool arantor, I understand more now what your getting at. anyway I
have choosen to go with the code would make more sense.


Would you believe it that i live in gods country
Australia

Nick Whetstone

#28
I *think* this is what you wanted...
In BoardIndex.template.php
Code (find) Select
// This is the "Recent Posts" bar.

Code (before) Select
// Friends list
echo '<div class="titlebg" style="width:100%; text-align: center; padding-top: 5px; padding-bottom: 5px;">Friends</div>
<table style="border: 0; width: 100%; text-align: center;" align="center">
<tr>
<td>Friends</td>
<td>Friends</td>
<td>Friends</td>
</tr>
<tr>
<td>Friends</td>
<td>Friends</td>
<td>Friends</td>
</tr>
<tr>
<td>Friends</td>
<td>Friends</td>
<td>Friends</td>
</tr>
</table>
<div class="titlebg" style="width:100%; text-align: center; padding-top: 5px; padding-bottom: 5px;">Blogs and others</div>
<table style="border: 0; width: 100%; text-align: center;" align="center">
<tr>
<td>Friends</td>
<td>Friends</td>
<td>Friends</td>
</tr>
<tr>
<td>Friends</td>
<td>Friends</td>
<td>Friends</td>
</tr>
<tr>
<td>Friends</td>
<td>Friends</td>
<td>Friends</td>
</tr>
</table>';
// End friends list
The artist formerly known as (Ha)²

Former Support Specialist

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

Arantor

Well there should be closing </tr> before opening new ones but other than that... looks like it might be right.

Nick Whetstone

Quote from: Arantor on December 12, 2009, 03:04:09 AM
Well there should be closing </tr> before opening new ones but other than that... looks like it might be right.

Oh, wow... you're right. I forgot to close them :P I'll do that now
The artist formerly known as (Ha)²

Former Support Specialist

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

SISPro

thank you that looks great and so far works

Nick Whetstone

Good to know... Again, sorry it took so long.
The artist formerly known as (Ha)²

Former Support Specialist

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

coldy316


Its in and working like a charm, thank you so much for that.

Would you believe it that i live in gods country
Australia

Advertisement: