TinyPortal

Development => Support => Topic started by: mattb on April 06, 2010, 10:09:21 AM

Title: Error while adding block
Post by: mattb on April 06, 2010, 10:09:21 AM
hello,

im getting this while trying to add a block

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'http://quantumxgamers.com/livezilla/livezilla.php','','width=590,height=550,left' at line 1
File: /home/quantu48/public_html/Sources/TPortalAdmin.php
Line: 2362

and theres this page [1] thing in the portal i want to get rid of

also how can i add a page with tp?

thanks
Title: Re: Error while adding block
Post by: Skhilled on April 06, 2010, 02:07:56 PM
First, the staff will need some help from you like what TP and SMF version you are using as well as the type of block you are trying to add as well as the custon code you are using, if any.

To add a page with TP you have to create articles. Those are the pages.

Title: Re: Error while adding block
Post by: mattb on April 07, 2010, 07:12:14 AM
ok im using tiny portal beta 5

and smf 2.0 RC3

i was adding a block and get this error


Database Error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'http://quantumxgamers.com/livezilla/livezilla.php','','width=590,height=550,left' at line 1
File: /home/quantu48/public_html/Sources/TPortalAdmin.php
Line: 2362


while trying to add this html code:

<!-- http://www.LiveZilla.net Chat Button Link Code --><div style="text-align:center;width:191px;"><a href="javascript:void(window.open('http://quantumxgamers.com/livezilla/livezilla.php','','width=590,height=550,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes'))"><img src="http://quantumxgamers.com/livezilla/image.php?id=02" width="191" height="69" border="0" alt="LiveZilla Live Help"></a><noscript><div><a href="http://quantumxgamers.com/livezilla/livezilla.php" target="_blank">Start Live Help Chat</a></div></noscript><div style="margin-top:2px;"><a href="http://www.livezilla.net" target="_blank" title="LiveZilla Live Chat" style="font-size:10px;color:#bfbfbf;text-decoration:none;font-family:verdana,arial,tahoma;">LiveZilla Live Chat</a></div></div><!-- http://www.LiveZilla.net Chat Button Link Code --><!-- http://www.LiveZilla.net Tracking Code --><div id="livezilla_tracking" style="display:none"></div><script type="text/javascript">var script = document.createElement("script");script.type="text/javascript";var src = "http://quantumxgamers.com/livezilla/server.php?request=track&output=jcrpt&nse="+Math.random();setTimeout("script.src=src;document.getElementById('livezilla_tracking').appendChild(script)",1);</script><!-- http://www.LiveZilla.net Tracking Code -->

1. i mean extra pages that go with my custom forum buttons

2. also how do i take off this

Pages: [1]  in the middle of my portal
Title: Re: Error while adding block
Post by: psa on April 07, 2010, 08:53:29 AM
I added code to TPSubs.php to suppress the 'Pages: [1]' when there was only one page.

Find:
function TPageIndex($base_url, &$start, $max_value, $num_per_page)
{
        global $modSettings, $txt;

and add right after the global definition:

        if ($max_value <= $num_per_page)
                return '&nbsp;';

I'm leaving a spacer in there to make sure none of the browsers try to collapse the (now likely empty) <div> where the template expects the page numbering to be.  It will leave a space on your page, though, which I think is preferable to distorting a template.

Edit:
I should mention that this code is similar to that in SMF already, in Subs.php -> constructPageIndex(), where the same fix won't work due to the "Pages:" localization string being added by the templates instead of the core methods.  A more complex fix would be needed, giving the template the ability to recognize the lack of additional pages and suppress the output, but dozens of template files are involved and any overriding themes would have to be updated individually.  Still technically possible with a custom theme, though (just look for '[1]' coming from $context['page_index'] and suppress).
Title: Re: Error while adding block
Post by: mattb on April 07, 2010, 09:36:15 AM
added it still nothing:

}
// Constructs a page list.
function TPageIndex($base_url, &$start, $max_value, $num_per_page)
{
global $modSettings, $txt;        if ($max_value <= $num_per_page)
                return '&nbsp;';

    $flexible_start = false;
// Save whether $start was less than 0 or not.
$start_invalid = $start < 0;
Title: Re: Error while adding block
Post by: psa on April 07, 2010, 10:32:34 AM
This just removes the page number if you only have one page, it doesn't address your other issue.
I'm not seeing the Pages line at http://quantumxgamers.com
Title: Re: Error while adding block
Post by: mattb on April 07, 2010, 11:31:31 AM
ah i see thanks

can i ask one more thing

how would i be able to create pages that go with my custom forum buttons, i use to use ezportal and it had a page manager which would allow you too add html pages and such.
Title: Re: Error while adding block
Post by: Skhilled on April 07, 2010, 01:35:09 PM
The articles can be php, html, flash or any other kind of pages you can think of. To add the page code to a block you'll need the article number. If the article number is 3 then add "http://yoursite.com/index.php?page=3" or "?page=3" to show a link on a menu block or anywhere else.