Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
  #1006  
Old 14 Oct 2013, 22:51
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
You can't use echo or it will end up on the top of the page. You need to take your data and output it to a variable:

$myvar = '';
start of loop
$myvar .= "html here";
end of loop
make sure to register $myvar for use in your template

and in the template, put
{vb:raw myvar}
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #1007  
Old 14 Oct 2013, 23:42
smirkley smirkley is offline
 
Join Date: Apr 2008
Thanks, will give that a try.

(I suppose you saw my error in stating that the multiple "do" functions were put in the template, I meant they were put in the php file, each one with a different template used.)

--------------- Added 15 Oct 2013 at 02:11 ---------------

Ok, there is a reason I dont release mods here. Cous I seem to struggle with the obvious lol.

I have registered the variable,...
$templater->register('history', $history);

I thought I would just start simple and just have 1 row in my database. From there I will expand on it once I can get a simple read done.

This is my php query. (kinda found it while searching the forums and modified it to my purpose)


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But using {vb:raw history} in my template produces a blank whereas there is actual data in the database fields.

Last edited by smirkley; 15 Oct 2013 at 02:16.
Reply With Quote
  #1008  
Old 15 Oct 2013, 22:17
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
I would use fetch_array in case you to later have multiple rows and you should specify the field you want. Assuming you want history.field, then:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and then in the template:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #1009  
Old 15 Oct 2013, 23:49
FBRN_Andrew FBRN_Andrew is offline
 
Join Date: Sep 2013
Originally Posted by Zoul View Post
Hello FBRN_Andrew

if I'm not mistaken, and I understand the question in the template created, you just add this before the tag
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
thanks for the reply
Greetings I added the lines you included, the page looks much better, but still seems to be in a "not logged in" mode.

I'm not much of a PHP coder so I don't really know what code I should paste in to explain.

--------------- Added 15 Oct 2013 at 23:54 ---------------

Also since the 4.2.2 patch I removed the tabs hack and changed to navigation manager, using "member" as the group to see most tabs. so when I go to the new page the menu(tabs) also switch to logged out mode. however clicking the home link, or back puts you back to logged in status.
Reply With Quote
  #1010  
Old 16 Oct 2013, 03:50
smirkley smirkley is offline
 
Join Date: Apr 2008
Originally Posted by Lynne View Post
I would use fetch_array in case you to later have multiple rows and you should specify the field you want. Assuming you want history.field, then:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and then in the template:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Lynne, I do appreciate your valued input.
I tried to make it work but I produced db errors in the process.

Info: I have one row now, but I anticipate in the future many rows, each one containing 7 columns. And in this routine I wish to list on my page all the rows.

So this is what I did with your suggestion....



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

with the variable registered as stated.


But this doesnt work nicely with sql.

My apologies for being not so sql inclined, and I dont wish to burdon you with 'teaching' me how to make this work, but I am not so skilled at database manipulation.
(I am hoping to learn how to make this work so I wont be such a bother in the future)

--------------- Added 17 Oct 2013 at 02:36 ---------------

I have decided I am going to do a crash course on sql. I need to be able to do more than hope someone here can hold my hand making something that would otherwise add several pages in this thread. The above responces have indeed helped me, but what I am trying to create is going to be propietary to my website, and I am stumped on just the first section of it out of several. It is my responsibility to educate myself so my questions remain more attached to the subject.

Lynne, you have been a great help especially with this tutorial.
This is in fact an amazing addition to anyone that wishes to do custom pages using templates, php, etc, on a forum setup.

Thanks again.
Reply With Quote
  #1011  
Old 19 Oct 2013, 16:25
stevectaylor stevectaylor is offline
 
Join Date: Aug 2007
Originally Posted by Lynne View Post
Did you try just adding them into the template after the headininclude template is called?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and then change the condition in the headinclude template to not show those for your page:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Hi Lynn,

A little stuck on this?

--------------- Added 19 Oct 2013 at 16:45 ---------------

And if just by a little fairy dust of posting that if came too me what I did wrong. lol
Reply With Quote
  #1012  
Old 20 Oct 2013, 14:30
MacroPhotoPro MacroPhotoPro is offline
 
Join Date: Feb 2012
Hello;

I am creating an image-hosting website for which I require custom pages. This page serves the purpose, but I notice that it does not automatically re-size like the other vBulletin pages (see attached).

For example, my main desktop monitor has 1920 screen resolution, whereas the ancient laptop I am on right now only has 1024 screen resolution.

When I view the vBulletin forum on the smaller screen, everything is automatically re-sized so that it fits my 1024 resolution screen. (it even gets re-sized to fit my smartphone screen.

However, my custom page does NOT automatically re-size, and so the excess images/text kind of "spills over" to the right (again see attachments for a comparison).

So my question is, how do I construct my custom pages so that they too automatically re-size to fit smaller screens?

Thanks for any help,

Jack
Attached Images
File Type: jpg custom.JPG (84.0 KB, 12 views)
File Type: jpg forum.JPG (158.4 KB, 10 views)
Reply With Quote
  #1013  
Old 20 Oct 2013, 16:19
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
My guess: Do you use a mobile style? If that is the case, you need to have a fitting template for your cutom page in your mobile style.
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again.

http://www.roma-antiqua.de
Reply With Quote
  #1014  
Old 20 Oct 2013, 17:13
MacroPhotoPro MacroPhotoPro is offline
 
Join Date: Feb 2012
Originally Posted by cellarius View Post
My guess: Do you use a mobile style? If that is the case, you need to have a fitting template for your cutom page in your mobile style.
Thank you for answering, but it has nothing to do with the mobile style. It has to do with some kind of auto-resolving I think.

For example, there is no mobile style being used when I click the forum tab, yet the forum.php page automatically resolves to fit the resolution of my smaller screen ... yet this same thing does not happen when I click my ImageHosting tab and get my imagehosting.php page.

In no case have I employed my mobile style. I have used my own customized style, yet some kind of coding is in my forum.php page that is not in my custom php page, and that "something" is what I am inquiring about

Thanks again,

Jack
Reply With Quote
  #1015  
Old 20 Oct 2013, 17:47
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Real name: Mark Daniel Martinez
Originally Posted by MacroPhotoPro View Post
Hello;

I am creating an image-hosting website for which I require custom pages. This page serves the purpose, but I notice that it does not automatically re-size like the other vBulletin pages (see attached).

For example, my main desktop monitor has 1920 screen resolution, whereas the ancient laptop I am on right now only has 1024 screen resolution.

When I view the vBulletin forum on the smaller screen, everything is automatically re-sized so that it fits my 1024 resolution screen. (it even gets re-sized to fit my smartphone screen.

However, my custom page does NOT automatically re-size, and so the excess images/text kind of "spills over" to the right (again see attachments for a comparison).

So my question is, how do I construct my custom pages so that they too automatically re-size to fit smaller screens?

Thanks for any help,

Jack
What is the width parameters set for the large image displayed in the photo pages? Do you have a max-width set, because that seems to be what's pushing the images off screen.
__________________
Reply With Quote
  #1016  
Old 20 Oct 2013, 17:56
MacroPhotoPro MacroPhotoPro is offline
 
Join Date: Feb 2012
Originally Posted by Digital Jedi View Post
What is the width parameters set for the large image displayed in the photo pages? Do you have a max-width set, because that seems to be what's pushing the images off screen.

I don't know. Possibly, yes. We have different-sized thumbnails: tiny, small, medium, large, jumbo (150 px, 400 px, 800 px, 1200 px, and 2500 px).

I just use the template, and so maybe there can be some kind of "flexible" coding employed that adjusts???

Thank you.
Reply With Quote
  #1017  
Old 20 Oct 2013, 18:28
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by MacroPhotoPro View Post
I don't know. Possibly, yes. We have different-sized thumbnails: tiny, small, medium, large, jumbo (150 px, 400 px, 800 px, 1200 px, and 2500 px).

I just use the template, and so maybe there can be some kind of "flexible" coding employed that adjusts???

Thank you.
If you want images to automatically resize when you change the browser size, then you need to write some CSS to have it do this. The only way we can help with that is if you post a link to the custom page with the images on it.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #1018  
Old 23 Oct 2013, 23:45
Rudiere Rudiere is offline
 
Join Date: Aug 2013
Originally Posted by Lynne View Post
You can't use echo or it will end up on the top of the page. You need to take your data and output it to a variable:

$myvar = '';
start of loop
$myvar .= "html here";
end of loop
make sure to register $myvar for use in your template

and in the template, put
{vb:raw myvar}
Where do I put this code?

To perform within the models.
Reply With Quote
  #1019  
Old 24 Oct 2013, 02:32
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by Rudiere View Post
Where do I put this code?

To perform within the models.
The top is php code, so it goes into your php file. The bottom is template code so it goes into your template. But that was in answer to a question and isn't going to help you much unless you understood the original question and what was going on.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #1020  
Old 09 Nov 2013, 17:30
MacroPhotoPro MacroPhotoPro is offline
 
Join Date: Feb 2012
One of the things I noticed on this "custom page" is that photographs which are put on the page do NOT display on Facebook ... whereas they DO display on default vBulletin pages.

For example, if I have a photo on a Forum post, or a Blog Post, or an Article post ... and if I place the URL to that post/article on Facebook ... I get a choice of photo thumbnails to choose from, to associate on Facebook, which includes the photos that I want displayed.

But that does not work for this custom page here. When I post the URL of any page I create with this template on FB, my choice of thumbnails only shows the vBulletin Logo or my Avatar ... any photos I post are not available. What do I have to do to change this?

When I have a photo on this custom page, and if I post the URL to it, I want my photos to be among the thumbnail choices I have.

How can I accomplish this?

Thanks,
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 10:15.

Layout Options | Width: Wide Color: