vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Portal Software - WebTemplates 3.7.x: VB Integrated CMS (Content Management System) (https://vborg.vbsupport.ru/showthread.php?t=186644)

segwayon 11-03-2008 09:00 PM

Thanks Logician, for a really cool mod. It works like a charm. I am having a minor template issue, though, and can't figure out where it's coming from.

In the navbar template, there's the top row which contains the "navbits_start.gif" folder-looking icon file. Using this webtemplate, while that folder icon sits okay to the lefthand side, the beadcrumbs next to this image file centered inside its TD column rather than sitting justified to the left next to that folder icon. It only happens with our default "Transparencity+" style, as all other selected styles render the navbar within your webtemplates okay. And when I compare word for word, both navbar templates look identical to me (the one which is mysteriously centered and another which is fine), and so it might be in a CSS section perhaps. I wish I knew where to look to find out why the breadcrumbs want to float away to the center.

Any pointers appreciated.

Logician 11-05-2008 12:46 PM

Quote:

Originally Posted by ishare (Post 1658781)
Can not find the right variable for the forum title :
When i list the threads of forumid=2, i can sort them through the letterbar. In the current letterbar, there are "Title", "Author" and "Date" sections. I did add another section called "Forum" which will show the forum title of the thread which it belongs to.

query changes as

PHP Code:

SELECT t.threadidt.titlet.postusername,t.postuserid,t.datelinef.title as forumtitle 
FROM 
" . TABLE_PREFIX . "thread t
LEFT JOIN 
" . TABLE_PREFIX . "forum f ON f.forumid=t.forumid
WHERE t
.sticky=AND t.visible=AND t.forumid=3 $letterquery 
ORDER BY t
.dateline DESC
LIMIT 500 

and Query PHPInclude Code (Before) as:

PHP Code:

$myletter1 substr($myletter01);
if (
$myletter == '_')
{
        
$letterquery "AND (t.title LIKE '0%'  OR t.title LIKE '1%'  OR t.title LIKE '2%'  OR t.title LIKE '3%'  OR t.title LIKE '4%'  OR t.title LIKE '5%'  OR t.title LIKE '6%'  OR t.title LIKE '7%'  OR t.title LIKE '8%'  OR t.title LIKE '9%') ";
}
else
{
     
$letterquery "AND t.title LIKE '$myletter1%'";





Quote:

Originally Posted by ishare (Post 1658781)
Is it possible to pull threads from different forums at same time ?

WHERE sticky=0 AND visible=1 AND (forumid=103 OR forumid=104 OR forumid=105) $letterquery

Logician 11-05-2008 12:49 PM

Quote:

Originally Posted by segwayon (Post 1658872)
Thanks Logician, for a really cool mod. It works like a charm. I am having a minor template issue, though, and can't figure out where it's coming from.

In the navbar template, there's the top row which contains the "navbits_start.gif" folder-looking icon file. Using this webtemplate, while that folder icon sits okay to the lefthand side, the beadcrumbs next to this image file centered inside its TD column rather than sitting justified to the left next to that folder icon. It only happens with our default "Transparencity+" style, as all other selected styles render the navbar within your webtemplates okay. And when I compare word for word, both navbar templates look identical to me (the one which is mysteriously centered and another which is fine), and so it might be in a CSS section perhaps. I wish I knew where to look to find out why the breadcrumbs want to float away to the center.

Any pointers appreciated.

Webtemplates does not have a different CSS section. It just inherits your CSS. You must make sure you use "default vb header/footer" in your webtemplates. If you already do, I'd say it should be an issue of your custom style. Please also compare CSS sections (before </head> tag) with word. You can maybe catch a pattern there

maidos 11-05-2008 05:43 PM

do you allow css coding on webtemplate, i wish to add rounded boxes

Logician 11-05-2008 07:45 PM

Quote:

Originally Posted by maidos (Post 1660016)
do you allow css coding on webtemplate, i wish to add rounded boxes

You can add it to your vb css as:

<if condition="THIS_SCRIPT==view">
your css for webtemplates
</if>

maidos 11-05-2008 09:04 PM

thanks but exactly where do i add it, i added on style manager, forum skin, main css but it doesnt work
please be a little more specific
have this
PHP Code:


<if condition="THIS_SCRIPT==view">
.
rtop,.rbottom{display:block}
.
rtop *,.rbottom *{display:block;height1px;overflowhidden}
.
r1{margin0 5px}
.
r2{margin0 3px}
.
r3{margin0 2px}
.
r4{margin0 1px;height2px}

.
rs1{margin0 2px}
.
rs2{margin0 1px}
</if> 


i dont want to use image to get the corners so i chose js instead but where will i add this js file?

PHP Code:

function NiftyCheck()
{
if(!
document.getElementById || !document.createElement)
    return(
false);
var 
b=navigator.userAgent.toLowerCase();
if(
b.indexOf("msie 5")>&& b.indexOf("opera")==-1)
    return(
false);
return(
true);
}

function 
Rounded(selector,bk,color,size){
var 
i;
var 
v=getElementsBySelector(selector);
var 
l=v.length;
for(
i=0;i<l;i++){
    
AddTop(v[i],bk,color,size);
    
AddBottom(v[i],bk,color,size);
    }
}

function 
RoundedTop(selector,bk,color,size){
var 
i;
var 
v=getElementsBySelector(selector);
for(
i=0;i<v.length;i++)
    
AddTop(v[i],bk,color,size);
}

function 
RoundedBottom(selector,bk,color,size){
var 
i;
var 
v=getElementsBySelector(selector);
for(
i=0;i<v.length;i++)
    
AddBottom(v[i],bk,color,size);
}

function 
AddTop(el,bk,color,size){
var 
i;
var 
d=document.createElement("b");
var 
cn="r";
var 
lim=4;
if(
size && size=="small"){ cn="rs"lim=2}
d.className="rtop";
d.style.backgroundColor=bk;
for(
i=1;i<=lim;i++){
    var 
x=document.createElement("b");
    
x.className=cn i;
    
x.style.backgroundColor=color;
    
d.appendChild(x);
    }
el.insertBefore(d,el.firstChild);
}

function 
AddBottom(el,bk,color,size){
var 
i;
var 
d=document.createElement("b");
var 
cn="r";
var 
lim=4;
if(
size && size=="small"){ cn="rs"lim=2}
d.className="rbottom";
d.style.backgroundColor=bk;
for(
i=lim;i>0;i--){
    var 
x=document.createElement("b");
    
x.className=cn i;
    
x.style.backgroundColor=color;
    
d.appendChild(x);
    }
el.appendChild(d,el.firstChild);
}

function 
getElementsBySelector(selector){
var 
i;
var 
s=[];
var 
selid="";
var 
selclass="";
var 
tag=selector;
var 
objlist=[];
if(
selector.indexOf(" ")>0){  //descendant selector like "tag#id tag"
    
s=selector.split(" ");
    var 
fs=s[0].split("#");
    if(
fs.length==1) return(objlist);
    return(
document.getElementById(fs[1]).getElementsByTagName(s[1]));
    }
if(
selector.indexOf("#")>0){ //id selector like "tag#id"
    
s=selector.split("#");
    
tag=s[0];
    
selid=s[1];
    }
if(
selid!=""){
    
objlist.push(document.getElementById(selid));
    return(
objlist);
    }
if(
selector.indexOf(".")>0){  //class selector like "tag.class"
    
s=selector.split(".");
    
tag=s[0];
    
selclass=s[1];
    }
var 
v=document.getElementsByTagName(tag);  // tag selector like "tag"
if(selclass=="")
    return(
v);
for(
i=0;i<v.length;i++){
    if(
v[i].className==selclass){
        
objlist.push(v[i]);
        }
    }
return(
objlist);



rapidphim 11-09-2008 06:35 AM

Is there a way for me to create an html frameset page? I want to create a page with top fixed frame and second frame with scrollable.

How can I do that with this hack? Thanks.

sparklywater 11-09-2008 03:08 PM

I'm using the '$WQ_testpagination' query to fetch a list of all the posts on my forum, see here http://www.sparklywater.com/posts.html. I have set the 'rows per page' setting to 30 in the 'PHP include' section of the webtemplate, like this:

Code:

$vbulletin->input->clean_array_gpc('r', array(
                'pagenumber'          => TYPE_INT,
                'perpage'                  => TYPE_INT,
        ));

        $pagenumber = $vbulletin->GPC['pagenumber'];
        $perpage = $vbulletin->GPC['perpage'];

        // ----------------------------------------------
        // Pagination
        // ----------------------------------------------
        //total actions records
        $totalrecordsC = $db->query_first("
SELECT COUNT(*) AS record FROM
" . TABLE_PREFIX . "thread AS thread
INNER JOIN " . TABLE_PREFIX . "post AS post on (post.postid = thread.lastpostid)
INNER JOIN " . TABLE_PREFIX . "forum AS forum on (thread.forumid = forum.forumid)
");
        $totalrecords = intval($totalrecordsC['record']);

        // set defaults for pagination
        if ($perpage == 0 or $perpage > 1000) {$perpage = 30;}
        if (!isset($pagenumber) or $pagenumber == 0) {$pagenumber = 1;}
        $limitlower = ($pagenumber - 1) * $perpage + 1;
        $limitupper = $limitupper = ($pagenumber) * $perpage;
        if ($limitupper > $totalrecords)
        {
        $limitupper = $totalrecords; 
                        if ($limitlower > $totalrecords) {$limitlower = $totalrecords - $perpage;}
        }
        if ($limitlower <= 0) {$limitlower = 1;}
        $sel_limitlower = $limitlower;
                $sel_limitlowerminus1 = $sel_limitlower -1;

$pagenav = construct_page_nav($pagenumber, $perpage, $totalrecords, "$WT_Option_NameOFviewphp?$session[sessionurl]pg=$pg&perpage=$perpage");

        // -- /Pagination}



On the third page of my results, there are currently 25 rows / posts listed, so this should be the last page in the results (ie. no fourth page). However, in the pagenav at the bottom-right hand side, the 4th page number is listed and when clicking on page 4, the table simply states "No threads to List" (ie. the 'No Results Row' value). This 4th page is unnecessary because the final rows of results already ended on page 3.

Is there any way to fix this?

Logician 11-09-2008 03:57 PM

Quote:

Originally Posted by sparklywater (Post 1662386)
I'm using the '$WQ_testpagination' query to fetch a list of all the posts on my forum, see here http://www.sparklywater.com/posts.html. I have set the 'rows per page' setting to 30 in the 'PHP include' section of the webtemplate, like this:

Code:

$vbulletin->input->clean_array_gpc('r', array(
        'pagenumber'      => TYPE_INT,
        'perpage'          => TYPE_INT,
    ));
 
    $pagenumber = $vbulletin->GPC['pagenumber'];
    $perpage = $vbulletin->GPC['perpage'];
 
    // ----------------------------------------------
    // Pagination
    // ----------------------------------------------
    //total actions records
    $totalrecordsC = $db->query_first("
SELECT COUNT(*) AS record FROM
" . TABLE_PREFIX . "thread AS thread
INNER JOIN " . TABLE_PREFIX . "post AS post on (post.postid = thread.lastpostid)
INNER JOIN " . TABLE_PREFIX . "forum AS forum on (thread.forumid = forum.forumid)
");
    $totalrecords = intval($totalrecordsC['record']);
 
    // set defaults for pagination
    if ($perpage == 0 or $perpage > 1000) {$perpage = 30;}
    if (!isset($pagenumber) or $pagenumber == 0) {$pagenumber = 1;}
    $limitlower = ($pagenumber - 1) * $perpage + 1;
    $limitupper = $limitupper = ($pagenumber) * $perpage;
    if ($limitupper > $totalrecords)
    {
    $limitupper = $totalrecords; 
            if ($limitlower > $totalrecords) {$limitlower = $totalrecords - $perpage;}
    }
    if ($limitlower <= 0) {$limitlower = 1;}
    $sel_limitlower = $limitlower;
                $sel_limitlowerminus1 = $sel_limitlower -1;
 
$pagenav = construct_page_nav($pagenumber, $perpage, $totalrecords, "$WT_Option_NameOFviewphp?$session[sessionurl]pg=$pg&perpage=$perpage");
 
    // -- /Pagination}



On the third page of my results, there are currently 25 rows / posts listed, so this should be the last page in the results (ie. no fourth page). However, in the pagenav at the bottom-right hand side, the 4th page number is listed and when clicking on page 4, the table simply states "No threads to List" (ie. the 'No Results Row' value). This 4th page is unnecessary because the final rows of results already ended on page 3.

Is there any way to fix this?

Make sure you use the same query in your webquery and also in the section :

Quote:

$totalrecordsC = $db->query_first("
SELECT COUNT(*) AS record FROM
" . TABLE_PREFIX . "thread AS thread
INNER JOIN " . TABLE_PREFIX . "post AS post on (post.postid = thread.lastpostid)
INNER JOIN " . TABLE_PREFIX . "forum AS forum on (thread.forumid = forum.forumid)
");
You can be using different queries which causes the problem.

rapidphim 11-09-2008 10:01 PM

logician, would you able to help me with above question?


All times are GMT. The time now is 08:36 PM.

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.01564 seconds
  • Memory Usage 1,851KB
  • 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
  • (2)bbcode_code_printable
  • (4)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete