Jump to content
php.lv forumi

goma smile

Reģistrētie lietotāji
  • Posts

    568
  • Joined

  • Last visited

Posts posted by goma smile

  1. kas tie pa failiem .asp ?? ka var uz php partaisit

     

    rekas vina ieksa

     

     

    <!-- #include file="Config.inc" -->
    
    <html>
    
    <head>
    <title>Forum v1.00 :: Created by Tjoekbezoer (c)</title>
    
    <body bgcolor="<%= BackgroundColor %>"  link="<%= LinkColor %>" vlink="<%= LinkColorVisited %>" alink="<%= LinkColorActive %>">
    <!-- #include file="Style.inc" -->
    </head>
    
    <%= note %>
    
    <%
    'If the querystring for accessing a board is empty (id1), then display the board survey
    If Request.Querystring("id1") = "" Then
    %>
    <table width=<%= TableSurveyAllWidth %> border=0 cellspacing=0 cellpadding=5>
    
    <tr>
    <td colspan=2 class="Left" align=left width="<%= TableSurveyBoardsWidth %>"><font face="Arial" color="Black" size=3><b>Boards:</b></font></td>
    <td class="Middle" align=left width="<%= TableSurveyPostsWidth %>"><font face="Arial" color="Black" size=3><b>Posts:</b></font></td>
    <td class="Right" align=left width="<%= TableSurveyReactionsWidth %>"><font face="Arial" color="Black" size=3><b>Reactions:</b></font></td>
    </tr>
    
    <tr><td height=10></tr>
    
    <%
    
    Set oConn = Server.CreateObject("ADODB.Connection")
    oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(vPath & "messages.mdb"))
    
    
    'Display all the topics defined in Config.inc
    i=0
    j=1
    For Each topic in Topics
    sSQLP = "SELECT Count(*) AS amount FROM messages WHERE Id1 =" & j & " AND OriginalMessage = 'Yes'"
    Set Posts = oConn.Execute(sSQLP)
    sSQLR = "SELECT Count(*) AS amount FROM messages WHERE Id1 =" & j & " AND OriginalMessage = 'No'"
    Set Reactions = oConn.Execute(sSQLR)
    
    Response.Write "<tr style='font-family=Arial;color=Black;font-size=14px'>"
    Response.Write"<td class='ContLeft'><img src='Images/Folder.gif' width=40 height=30></td>"
    Response.Write "<td class='ContMiddle' width=70% height=60 align=left>"
    Response.Write "<a href='index.asp?id1=" & TopicID(i) & "'><font color='Black'>" & topic & "</font></a><br>"
    Response.Write "<font size=1 face='Verdana'>" & TopicDesc(i) & "</font>"
    Response.Write "</td>"
    Response.Write "<td class='ContMiddle'>" & Posts("amount").Value & "</td>"
    Response.Write "<td class='ContRight'>" & Reactions("amount").Value & "</td>"
    Response.Write "</tr><tr><td height=10></td></tr>"
    i = i+1
    j = j + 1
    Next
    
    Response.Write "</table>"
    
    'If id1 querystring is not empty, display the board with that id1 number
    Else
    %>
    
    
    <%
    Id1 = Request.Querystring("id1")
    Board = Id1 - 1
    
    Set oConn = Server.CreateObject("ADODB.Connection")
    oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(vPath & "messages.mdb"))
    
    
    sSQL = "SELECT Id1, Id2, Id3, Titel, Name, LastReaction, LastReactionId, Locked FROM messages WHERE OriginalMessage = 'Yes' AND Id1 = " & Id1 & " ORDER BY LastReaction DESC"
    
    Set Forum = oConn.Execute(sSQL)
    %>
    
    <font style="font-family=<%= BoardStandardFontFace %>;color=<%= BoardStandardFontColor %>;font-size=<%= BoardStandardFontSize %>">
    
    <font size=4>Board: <b><%= Topics(Board) %></b></font><br>
    <br>
    
    << <a href="index.asp">Back to the Board Survey</a> | <a href="Form_Message.asp?id1=<%= Id1 %>">Create new discussion</a> >><br>
    <br>
    
    <table border=0 cellspacing=0 cellpadding=0 width=100%>
    
    <tr style="font-family=<%= BoardTitleFontFace %>;color=<%= BoardTitleFontColor %>;font-size=<%= BoardTitleFontSize %>;font-weight=Bold">
    <td colspan=2 class="Left" align=left width=50%>Title:</td>
    <td class="Middle" align=left>Reactions:</td>
    <td class="Middle" align=left nowrap>Started by:</td>
    <td class="Right" align=left nowrap>Last reaction:</td>
    </tr>
    
    
    <% Do While NOT Forum.EOF %>
    <tr style="font-family=<%= BoardThreadFontFace %>;color=<%= BoardThreadFontColor %>;font-size=<%= BoardThreadFontSize %>" bgcolor="<%= TableThreadColorLight %>">
    <td align=left>
    <% 'Checking if Thread is Locked
    Locked = Forum("Locked").Value
    If Locked = "Yes" Then
    %>
    <img src="Images/Lock.gif" width=17 height=16 alt="This means it's a closed discussion. You need a password to access this discussion." border=0>
    <% Else %><b></b><% End If %>
    </td>
    <td align=left height=35>
    <% If Session("Mod") = "Yes" Then %>
    <a href="Delete.asp?Id2=<%= Forum("Id2").Value %>" target="_new"><font color="Red"><b>DEL</b></font></a> | 
    <% End If %>
    <a href="message.asp?id3=<% =Forum("Id3").Value %>"><% =Forum("Titel").Value %></a>
    </font>
    </td>
    <td align=left>
    <% id2 = Forum("Id2").Value %>	
    <%
    sSQLR = "SELECT Count(*) AS amount FROM messages WHERE Id2 =" & id2 & " AND OriginalMessage = 'No'"
    Set Reacties = oConn.Execute(sSQLR)
    %>
        <%= Reacties("amount").Value %>
    </font>
    </td>
    <td align=left>
    <% =Forum("Name").Value %>
    </font>
    </td>
    <td align=left>
    <% =Forum("LastReaction").Value %>
    </font>
    </td>
    </tr>
    
    <%
    Forum.MoveNext
    If Forum.EOF Then
    %>
    <tr><td></td></tr>
    <% Else %>
    
    <tr style="font-family=<%= BoardThreadFontFace %>;color=<%= BoardThreadFontColor %>;font-size=<%= BoardThreadFontSize %>" bgcolor="<%= TableThreadColorDark %>">
    <td align=left>
    <% 'Checking if Thread is Locked
    Locked = Forum("Locked").Value
    If Locked = "Yes" Then
    %>
    <img src="Images/Lock.gif" width=17 height=16 alt="This means it's a closed discussion. You need a password to access this discussion." border=0>
    <% Else %><b></b><% End If %>
    </td>
    <td align=left height=35>
    <% If Session("Mod") = "Yes" Then %>
    <a href="Delete.asp?Id2=<%= Forum("Id2").Value %>" target="_new"><font color="Red"><b>DEL</b></font></a> | 
    <% End If %>
    <a href="message.asp?id3=<% =Forum("Id3").Value %>"><% =Forum("Titel").Value %></a>
    </font>
    </td>
    <td align=left>
    <% id2 = Forum("Id2").Value %>	
    <%
    sSQLR = "SELECT Count(*) AS amount FROM messages WHERE Id2 =" & id2 & " AND OriginalMessage = 'No'"
    Set Reacties = oConn.Execute(sSQLR)
    %>
        <%= Reacties("amount").Value %>
    </font>
    </td>
    <td align=left>
    <% =Forum("Name").Value %>
    </font>
    </td>
    <td align=left>
    <% =Forum("LastReaction").Value %>
    </font>
    </td>
    </tr>
    <%
    Forum.MoveNext
    End If
    Loop
    %>
    
    
    </table>
    <% End If %>
    
    
    </table>

  2. labdien,

     

    Man ir tads jautajums .....

     

    man ir registracijas sistema un es gribetu uztaisiit ta ka piemeram izkir adminos un lietotajos man ir ta ka kad tu registrejies tu tavs status taka ir 1. bet adminiem 2 un pie userinfo parada

     

     

    Piemers (nezinu vai pareizs ..... )

    mysql_query("SELECT * FROM Users WHERE pakape");
    $user=1 {
    $user="LIetotaajs"
    }
    $user=2{
    $user="Administrators"
    }

    nu kautka ta

  3. vai kads varetu pateikt kodu..... uz to lai piemeram es gribu ka no bildes linka kas ir msql ieziet caur php uz ekranu nu tas izpaudisies sitadi

     

    man msql kad ir avatara links kuru es gribu atiecigi juseram lai paradas apskatot profilu uc....

     

    vo man liekas ka ir kautka ta :

     

    <?php
    
    
    //Profila bilde
    $result = mysql_query("SELECT * FROM users");
    $row = mysql_fetch_assoc($result);
    $img = getimagesize($row['bilde']);
    
    if($img[0] > 150) 
    {
    echo "<img src='{$row['bilde']}' alt='Profila bilde' />";
    else
    {
    echo "<img src='{$row['bilde']}' alt='Profila bilde' />";
    }
    
    ?>

     

    nu man ir ta bet nejiet :( kas varetu but pa vainu ?

     

    p.s. sory ja nav taja sadala :)

  4. kads veretu iedot kodu uz tadu fi4u

     

    piemeram ir bilde un es gribu lai atveras tads mazins lodzins kad uzpiez uz tas biles un tur butu kautkas rakstis

     

     

    Ta izskatas ka spiez uz pogas

     

    <html>
    <script type='text/javascript'>
    function linkTo(y)
    {
    var x=window.open('Info.php','','scrollbars=yes,width=275,height=200')
    x.location.hash=y
    }
    </script>
    </head>
    
    <body>
    <h1 align='center'><big><input type='button' value='sss' onclick='linkTo(0)'></big></h1>
    
    </body>
    
    </html>

     

    a es gribu lai kad spiez uz atlea atveras sitads pats lodzins ka to izdarit ?

  5. Kr4 mums ir ta :

     

    Mums ir divi serveri kas nav uz 1 ip piemeram viens pieder man,bet otrs kautkur kaiminos un uz maneja ir uzlikts amxbans tas ir ka web lapa rada banus a es gribu lai ari vina seerveris piesledzas manai amxbans web lapai un rada ari kas vina serveri ir nobanoti ka to izdarit ?

     

    to msql localhost nomainit uz ip ? un ka ?kur ?

  6. Jā, var.

    Šitā:

    echo "<img SRC=images/video.gif alt='Ievietoja ".$row['starter_name']." $piev_datums '> <a href=\"$forums/index.php?showtopic=".$row['tid']."\">[b]".(strlen($row['title'])>30?substr($row['title'],0,30).'...':$row['title'])."[/b]</a>	";

     

    Ja man būtu jāpārbauda teksta garums un attiecīgi jāizvada ar trīspunkti, es gan būtu pārbaudījis vai teksts ir garāks par (piemēram) 30 simboliem un ja ir garāks, tad izvadījis pirmos 27 + trīspunkti. Savādāk sanāk, ka bezjēgā tiek izmantota vieta trim simboliem.

     

     

    Paldies viss aizgaja :)

  7. echo "<img SRC=images/video.gif alt='Ievietoja ".$row['starter_name']." $piev_datums '> <a href=\"$forums/index.php?showtopic=".$row['tid']."\">[b]".$row['title']."[/b]</a>	";

     

    Man vaig lai tas Title nebutu garaks pa 30 zinmem,simboliem

×
×
  • Create New...