vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   need help in PHP code :) (https://vborg.vbsupport.ru/showthread.php?t=143411)

Almotmaiz.Net 03-28-2007 03:10 PM

need help in PHP code :)
 
heloo evey body ...

i Build a PHP code to get some Information from my VB database ..

wut's wrong in my code ..


PHP Code:

$AlzaabiChars intval(500);
$AlzaabiDisplay intval(3);
$SQL $db->query_read("
     SELECT post.dateline, post.pagetext, thread.threadid, thread.title
     FROM post, thread
     ORDER BY dateline DESC LIMIT 0, 
$AlzaabiDisplay");
while(
$Alzaabi $db->fetch_array($SQL)){
    if(
strlen($Alzaabi['pagetext']) > $AlzaabiChars){
       
$Alzaabi['pagetext'] = substr($Alzaabi['pagetext'], 0strrpos(substr($Alzaabi['pagetext'], 0$AlzaabiChars), ' ')) . '...';
   }else{
       
$Alzaabi['pagetext'] = $Alzaabi['pagetext']
   }
   eval(
'$Alzaabi .= "' fetch_template('Alzaabi') . '";');



HTML Code:

<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
        <tr>
                <td>
                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                        <tr>
                                <td><img border="0" src="images/KalbaEyes_tcat_02.gif" width="88" height="25"></td>
                                <td style="background-image: url('images/KalbaEyes_tcat_01.gif'); background-repeat: no-repeat; background-position: right center" width="100%">
                                <a href="showthread.php?t=$Alzaabi['threadid']">$Alzaabi['title']</a>
                                </td>
                        </tr>
                </table>
                </td>
        </tr>
        <tr>
                <td>
                <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
                        <tr>
                                <td class="alt1">
                                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                                        <tr>
                                                <td align="center">$Alzaabi['pagetext']</td>
                                        </tr>
                                        <tr>
                                                <td align="left">
                                                <a href="showthread.php?t=$Alzaabi['threadid']">Read more ..</a></td>
                                        </tr>
                                </table>
                                </td>
                        </tr>
                </table>
                </td>
        </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td><img border="0" src="images/shadow.gif" width="150" height="15"></td>
                <td width="100%">&nbsp;</td>
                <td><img border="0" src="images/rshadow.gif" width="150" height="15"></td>
        </tr>
</table>
<br />


need help

Lynne 03-28-2007 06:53 PM

What is the error message you are getting? It's hard to help when we don't know what you are seeing. (Do you have a test page we can look at?)

Almotmaiz.Net 03-28-2007 06:55 PM

no error msg .. give me a plank page without any result ..

TECK 03-30-2007 07:03 AM

$AlzaabiChars and $AlzaabiDisplay are already INT's, no need to redefine them again.
You can also toss the ELSE, is not needed. And you should use the slave query style. :)
BTW, you have a syntax error:
$Alzaabi['pagetext'] = $Alzaabi['pagetext']
You miss a ; at the end.
I hope you don't have a busy site, because your actual query will break your server, the way it is now.
Not to mention the permissions. If you have a private forum, your above query results will show to everyone, not making you a happy camper. :)

When you ask a code question, you need to tell us some decent info.
Are you inside a function (hook location, for example global_complete), so you globalize your $Alzaabi var?
Did you run the query to see what it outputs, as result?
Did you var_dumped $Alzaabi['pagetext'] in the loop?

I don't see any of this info posted into your thread. Without proper info, you cannot get proper answers.
Hackers will simply ignore you and you will get frustrated.

EDIT. Don't use the PHP bbcode, it wraps the code. Use the CODE value instead.


All times are GMT. The time now is 07:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01125 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete