Jump to content

LexHammer

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Posts posted by LexHammer

  1. Hello,

    i have this php code. Its for sms insertion of links in to table

    <table border="1">
    <?PHP
    
    $db_user = 'user';
    $db_pass = 'pass';
    $db_name = 'name';
    $db_host = 'localhost';
    if(mysql_connect($db_host,$db_user,$db_pass)) {
    mysql_select_db($db_name);
    mysql_query("CREATE TABLE IF NOT EXISTS smsads(id bigint unsigned primary key auto_increment, link varchar(255), fromnum varchar(60))");
    $res = mysql_query("SELECT * FROM smsads ORDER BY id DESC LIMIT 10");
    while($row = mysql_fetch_object($res)) {
    	$http_link = $row->link;
    	if(strstr($http_link, 'http') === FALSE) $http_link = 'http://'.$http_link;
    	echo "<tr><td><a href=\"{$http_link}\" target=\"_blank\">{$row->link}</a></td></tr>";
    }
    }
    ?>
    </table>

     

    The problem is that i use tpl files for the visual part and all my other tables are in tpl. How can i insert the table above in my tpl file, whitout loosing its functions?

  2. Hello,

    I want to make a list with 2 columns on one of my pages with link to categories on my page. But they appear in only one column (on below the other) and i want them to be like:

    Pictures      Videos

    Pictures2    Videos2

     

    These are my codes

    <li> <a href="user_album_add.php">Pictures</a>

    <li> <a href="user_album2_add.php">Pictures2</a>

    <li> <a href="user_video_add.php">Video</a>

    <li> <a href="user_video2_add.php">Video2</a>

     

    What should i do? Thank you!

  3. I want to make a table with bigger text font and i want the text in each cell to be centered, not aligned to right. What is the code for that?

     

    The table code

    {include file='header.tpl'}	
    
    
    
    <center><table border="1">
    <tr>
    <td></td>
    <td><b>Text1<b></td>
    <td><b><FONT COLOR="red">Text2</font></b></td>
    </tr>
    <tr>
    <td>TEST1</td>
    <td>TEST2</td>
    <td>TEST3</td>
    </tr>
    </table></center></font>
    {include file='footer.tpl'}

  4. Not working... nothing happens.

    I found this code in the login, which i have forgoten that is threre, which is for a "getting started" wizard, that guides you only the first time when you login to the page.

     

    This is the code

    // CHECK FOR REDIRECTION URL
    if(isset($_POST['return_url'])) { $return_url = $_POST['return_url']; } elseif(isset($_GET['return_url'])) { $return_url = $_GET['return_url']; } else { $return_url = ""; }
    $return_url = urldecode($return_url);
    $return_url = str_replace("&", "&", $return_url);
    if($return_url == "") { $return_url = "user_home_started.php"; }

     

    Can this be modified to work with the chat, but to apply every time on login, not just the first time?

  5. I dont know if you are using sessions or what, but when a user logs in, create a session variable or cookie like so

     

    $_SESSION['newLogin']=1;

     

    Then on the other pages do this:

    if ($_SESSION['newLogin']==1) { $_SESSION['newLogin']=0; header("javascript:launchChat();"); }

     

    Yes, i use sessions.

    But which page is "the other page" ?

    The code i gave is from login.php. The page that is is opened after login is user_home.php

    Which code should go where? :)

     

    I guess the code in login.php should looks like

    // USER IS LOGGED IN, FORWARD TO USER HOME
    if( $user->user_exists )
    {
      header("Location: user_home.php");
      if ($_SESSION['newLogin']==1) { $_SESSION['newLogin']=0; header("javascript:launchChat();"); }
      exit();
    }

     

    Am i wrong?

  6. On my page, when a user login he's redirects to user_home.php. I made it also to open the chat screen when the user login.

    This is the code:

    // USER IS LOGGED IN, FORWARD TO USER HOME
    if( $user->user_exists )
    {
      header("Location: user_home.php");
      header("javascript:launchChat();");
      exit();
    }

     

    The problem is that every time, the user open user_home.php, the chat screen reloads (the user is loged out and loged in to the chat).

    How to make the chat screen loads ONLY THE FIRST time, when the user login?

  7. That didnt worked. <body onload="chat();">, but that worked :) <body onload="javascript:launchChat();">. I also changed the page from user_home.php to login.php and the code is this:

    // USER IS LOGGED IN, FORWARD TO USER HOME
    if( $user->user_exists )
    {
      header("Location: user_home.php");
      header("javascript:launchChat();");
      exit();
    }

     

    The problem is that every time the user_home page is opened, the chat reloads. How to make it load only for the first time the user log in and not every time when he opens user_home.php?

     

  8. I dont know what else to show you... this is all i got.  The div was because of an option that can have text comment for the ad, but no need of that.

     

    Here is the row code without the div.

     

    <a href='[userprofile]'>

    <img src=[userphoto] width=[userphotowidth] border=0>

    </a>

     

    That will display the user's photo on the top of the page and when somebody click on it, he will be redirected to the profile.

     

    I think that making the pictures in a table with 10 pictures/row will be good if there is no other way now...

  9. I used your code, but no change at all, they are still in a column Just to tell you, that i have very low php skills so dont ask me to do anything:) I just can copy paste the code you give me and adjust it with my content...

    What about if the ads_display codes are inserted itno in a table?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.