Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Sep 2006
    Posts
    77
    Member #
    14004
    How could I influence a number of columns displayed in php script? Is it something which could be done using css/div tags? Or does the code altogether need to be changed?

    At the moment the display looks like this:

    Category 1
    subcategory.... subcategory.... subcategory
    subcategory.... subcategory.... subcategory

    Category 2
    subcategory.... subcategory.... subcategory
    subcategory.... subcategory.... subcategory

    Category 3
    subcategory.... subcategory.... subcategory


    I would like the display to look like this:

    Category 1........ Category 2.......... Category 3
    subcategory...... subcategory .........subcategory
    subcategory...... subcategory......... subcategory

    I asked the script owners if they could do something like this for me, but they don't offer customisation of the script.
    Thank you for suggestions

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,733
    Member #
    5580
    Liked
    718 times
    I'm visualizing something like this ...

    PHP Code:
    <style>
    #wrapper{
    width:700px
    }
    #col1{
    width:200px;
    padding: 0px 20px 0px 0px;
    float:left;
    }
    #col2{
    width:200px;
    padding: 0px 20px 0px 0px;
    float:left;
    }
    #col3{
    width:200px;
    padding: 0px 20px 0px 0px;
    float:left;
    }
    h1{
    font-weight:bold;
    font-size:13pt;
    }
    </style>

    <div id='wrapper'>
    <div id='col1'>
    <h1>Category 1</h1>
    <?php
    ... script loops through each category1 item
    ?>
    </div>

    <div id='col2'>
    <h1>Category 2</h1>
    <?php
    ... script loops through each category2 item
    ?>
    </div>

    <div id='col3'>
    <h1>Category 3</h1>
    <?php
    ... script loops through each category3 item
    ?>
    </div>

    </div>


  4. #3
    Member
    Join Date
    Sep 2006
    Posts
    77
    Member #
    14004
    Hi Mlseim,
    It is probably a little bit more complicated that I was describing. There is a little bit of php coding, then tables with category tag (as below), again some php code, and again subcategory tag.
    Categories are set by
    ".$categories[$key]."
    and subcategories by <a href='index.php?ct=$key'>".$categories[$key][0]."

    I'm not sure if I can post all file and if you would like to have a look...

  5. #4
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Yeah, what script? What does it do? I mean, it'd require some modification if it's done with tables, but if it's styled with CSS to begin with, then it'll be easier.

  6. #5
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,733
    Member #
    5580
    Liked
    718 times
    pierrot ...

    See if you can find the part in the PHP script where it has that loop
    you're talking about. cut out that part and past into a .txt file
    that you can include on a post.


  7. #6
    Member
    Join Date
    Sep 2006
    Posts
    77
    Member #
    14004
    Mlseim,
    Below is the top.php file responsible for the display. I'm not sure now if this is what you were asking for? Or should I look for <php loop in other files of the script?
    The categories are manage by line 42, subcategories by line 79


    1........ <?
    2........include('funcs2.php');
    3........function print_categories()
    4........{
    5........global $html_header, $html_footer, $categories,$ad_ind_width,
    6........$catl_width, $top_page_info, $top_page_width, $topsearchfields, $top_leftcol;
    7........echo $html_header;
    8........echo "
    9........<center>
    10...... <table width='$top_page_width' border=0 cellspacing=0 cellpadding=1>
    11......<tr>
    12......$top_leftcol
    13......<td valign='top'>
    14......".print_fav_ads_ind()."
    15......<table width='100%' bgcolor='#dddddd' border=0 cellspacing=0 cellpadding=1>
    16......<tr><td>
    17......<font FACE='ARIAL, HELVETICA' color='#000099' size=-1>
    18......<b>Categories:</b>
    19......</font>

    20......</td></tr><tr><td>
    21......<TABLE bgcolor='#ffffff' border='0' cellspacing=0 cellpadding='10' WIDTH='100%' >

    22......<tr><td>
    23......<TABLE bgcolor='#ffffff' border='0' cellspacing=0 cellpadding=8 WIDTH='100%' >
    24.......";
    25......$s357=0;
    26......foreach ($categories as $key => $value)
    27......{
    28......$aa1=split("_",$key);
    29......if($aa1[0] = = 'title')
    30......{
    31......if ($s357 = = '1')
    32......{
    33......echo "</TR>";
    34......$s357=0;
    35......}
    36......echo "
    37......<tr><td colspan='2'>
    38......<TABLE BORDER=0 WIDTH='100%' bgcolor='#ddeeee' cellspacing=0 cellpadding=1>
    39......<TR>
    40......<td>
    41.....<font FACE='ARIAL, HELVETICA' size=-1 color='#004400'><b>
    42.....".$categories[$key]."
    43.....</b></font>
    44.....</TD></TR></TABLE>
    45.....</td></tr>
    46.....";
    47.....}
    48.....else{
    49.....if($s357 != '1')
    50.....{ $s357='1';
    51.....echo "<TR><TD width='50%' VALIGN=TOP>";
    52.....print_cat_name($key);
    53.....echo "</TD>\n";
    54.....}
    55.....else
    56.....{ $s357='0';
    57.....echo "<TD width='50%' VALIGN=TOP>\n";
    58.....print_cat_name($key);
    59.....echo "</TD></TR>\n";
    60.....}
    61....}
    62....}
    63....echo "
    64....</table>
    65....</font>
    66....</td></tr></TABLE>
    67....</td></tr></TABLE>
    68....<p>
    69....</td></tr></TABLE></center>
    70....";
    71....echo $html_footer;
    72....exit;
    73....}
    74....function print_cat_name($key)
    75....{
    76....global $categories;
    77....echo "
    78....<font FACE='ARIAL, HELVETICA' size=-1>
    79....&nbsp;<a href='index.php?ct=$key'><b>".$categories[$key][0]."</b></a>
    80....</font>
    81....<br><font size='-1'>
    82....&nbsp; ".get_cat_count($key)." ads, updated: ".get_date_update($key)." . 83....</font></b>
    84....</li>
    85....</font>
    86....";
    87....}
    88....?>

  8. #7
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,733
    Member #
    5580
    Liked
    718 times
    Now, I'm just "winging-it" ... so make a copy of your original before you
    paste my code into your script. That way, you can go back. Better yet,
    make a complete duplicate and give me a link to your "new" script, so I can
    see where the <div> problems are (if there are any).

    Here it is:
    PHP Code:
    <?
    include('funcs2.php');
    function 
    print_categories()
    {
    global 
    $html_header$html_footer$categories,$ad_ind_width,
    $catl_width$top_page_info$top_page_width$topsearchfields$top_leftcol;
    echo 
    $html_header;
    echo 
    "
    <center>
    <table width='
    $top_page_width' border=0 cellspacing=0 cellpadding=1>
    <tr>
    $top_leftcol
    <td valign='top'>
    "
    .print_fav_ads_ind()."
    <table width='100%' bgcolor='#dddddd' border=0 cellspacing=0 cellpadding=1>
    <tr><td>
    <font FACE='ARIAL, HELVETICA' color='#000099' size=-1>
    <b>Categories:</b>
    </font>
    </td></tr><tr><td>
    <TABLE bgcolor='#ffffff' border='0' cellspacing=0 cellpadding='10' WIDTH='100%' >
    <tr><td>
    <TABLE bgcolor='#ffffff' border='0' cellspacing=0 cellpadding=8 WIDTH='100%' >
    "
    ;

    $s357=0;
    foreach (
    $categories as $key => $value)
    {
    $aa1=split("_",$key);
    if(
    $aa1[0] = = 'title')
    {
    if (
    $s357 = = '1')
    {
    echo 
    "</div>";
    $s357=0;
    }
    echo 
    "
    <div style='width:30%; float:left; padding-right:30px;'>
    <div style='font-family:arial; font-size:9pt; color:#004400; width:30%;'>
    "
    .$categories[$key]."
    </div>\n"
    ;
    $s357=1;
    }

    else{
    echo 
    "<div style='font-family:arial; font-size:9pt; color:#004400; width:30%;'>\n";
    print_cat_name($key);
    echo 
    "</div>\n";
    }
    }
    echo 
    "
    </div>
    </td></tr></TABLE>
    </td></tr></TABLE>
    <p>
    </td></tr></TABLE></center>
    "
    ;
    echo 
    $html_footer;
    exit;
    }
    function 
    print_cat_name($key)
    {
    global 
    $categories;
    echo 
    "
    <font FACE='ARIAL, HELVETICA' size=-1>
    &nbsp;<a href='index.php?ct=
    $key'><b>".$categories[$key][0]."</b></a>
    </font>
    <br><font size='-1'>
    &nbsp; "
    .get_cat_count($key)." ads, updated: ".get_date_update($key)." . 83....</font></b>
    </li>
    </font>
    "
    ;
    }
    ?>


  9. #8
    Member
    Join Date
    Sep 2006
    Posts
    77
    Member #
    14004
    Thank you very much for your help!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:57 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com