|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
//////////////////////////////////////////////////////////////////////////////// Y5 v/ X1 R: f/ m
// Theme Option
$ O. M* x4 x5 x1 K/ p$ ^% h( H8 |////////////////////////////////////////////////////////////////////////////////
* e; r* l v! |1 e5 L) R/ c# K8 a& |
$themename = "Zenx";
0 c5 @) u8 V) Y1 w. X4 ~' G; I/ I$shortname = str_replace(' ', '_', strtolower($themename));) E6 [% F2 n/ O6 N( ^' q; {$ X7 A
* p0 f" r" I& _' e& M
function get_theme_option($option)5 c# f6 {1 }' X- F
{: t& h" V# y3 ] f' W6 ?
global $shortname;
# t `) r, v- B return stripslashes(get_option($shortname . '_' . $option));, a& U: u5 K, Z5 E" U
}
7 x M( }7 R2 l! @9 v1 ^ R3 I% G- `, d( a% r% V
function get_theme_settings($option)
/ W+ R. [5 }1 ^* g{
. t$ h7 }3 {* {6 ~% F: B return stripslashes(get_option($option));' R8 t; m; U& b& Y
}% ~; x) Q1 r" G( x# m/ G4 Q" B
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
8 X( ?8 c# |3 P2 p. V& ~1 w1 p$wp_getcat = array();
, b4 h4 \8 k9 D( P0 }. ^foreach ($wp_dropdown_rd_admin as $category_list) {) M) K! ]. B/ ^* b- ? m
$wp_getcat[$category_list->term_id] = $category_list->name;8 Q3 z W- Q. `* ^0 `6 o w7 |
}; K% X- S" @3 O9 U ]7 i
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");2 V2 U% @5 A$ G. l5 K1 T, n
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");1 p1 W" i. i# @2 x8 W$ b$ X
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");8 b3 r6 _ M9 F0 b% M# p
1 l; f1 `# L* q: g
$options = array (
8 v4 }3 ~6 _! D% I I" g- Y8 f& Q% d# c. C
3 K$ z8 L7 n+ c& p7 ?0 j* _
array( "name" => "Blog Header Settings",
2 U3 y, Y; C* l! | "type" => "heading",* o7 E% ?5 c/ \& R4 v
),
7 f5 T/ m0 Y: [4 V4 n7 j8 z; w; o) j0 g% o
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) d8 x! u3 }+ ]( A. Z
"id" => $shortname."_header_logo_activate",
- `; Z; P1 c6 x% F/ a8 z "type" => "select",3 P n3 t2 t, a1 ]
"std" => "No",; S: m* w1 H1 m$ D, G- R, H. M
"options" => array("No", "Yes")),
2 ?. T4 w* A, b% e; U: l
8 G; U, C4 d$ b7 X- M, w' w array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
3 a) w9 z, ^$ n1 r7 Q/ f* F "id" => $shortname."_logo_url",
1 @* Y8 p+ Q0 \3 U "type" => "text",
8 o3 E6 O- X! o `: d6 J "box" => "social",
+ O; M6 l g- I$ f: V "std" => "",5 z2 v! W+ f2 H
),
) U7 S, K; ]5 Q8 O" s; W
3 Y, ^- V. s# N+ x9 m array( "name" => "Insert Header Banner HTML Code (Header)
; X6 \$ p6 i$ [7 Q9 A9 A1 y5 o( ] <br /><em>*Recommended Size 468 x 60</em>
. a j- X0 S! ~: Q' `" O. ]( [ <br /><em>*leave blank if not use</em>",2 Y5 U" M2 M6 A. c( G; d9 t
"id" => $shortname."_header_banner",
& D/ l: ^8 s9 }+ L# I+ Z# L "type" => "textarea",
$ b5 d7 u. A7 w K; y* U# X "std" => ""," M1 h0 `- U6 ` G* I U
),% K% i3 L# f0 G' Z V
6 ~; b: I& Y) B0 Q3 E' s( I5 o
array( "name" => "</div></div>",
! r; V. @0 o) M "type" => "close",# f; c4 B7 m" v5 i8 m
),4 K+ R7 d1 X2 v# P
! k& a1 d6 {% u" T; A6 b3 D r& x
' ]) P7 n! K! U2 G7 s array( "name" => "Header Navigation Settings",6 _ `. }+ x0 t9 G. _9 P. y) G& P
"type" => "heading",4 r3 @( U& v, j) j8 y- B
),; A8 N, c9 j4 o7 C. {: z
2 b; ?% ` ^% Y, r
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />0 e. a1 F+ ^6 C' q( w
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
. @! B/ @0 Y0 w; U5 {5 { <em>*Enter the page post ID number only</em><br />
( y% }8 e% Z8 P' u( b, k8 v <em>*separate by comma</em><br />/ C0 J' I2 A/ O) I* }
<em>*Exclude pages which you don't want to show on the header navigation</em>",
4 ?4 |3 B% m1 s/ X3 B/ k: {! Y "id" => $shortname."_header_page_navigation",
; E; J' V/ @) e3 v0 ^# d4 h, G "type" => "text",
" [) ^2 }0 D) m, i: M "std" => "",. m/ j5 }; T- ^, Y( m
),5 {+ ~3 U1 a9 J8 f- x
9 e- e _4 l, W2 d: X
array( "name" => "</div></div>",
5 s! @$ Q. E: w6 S2 } "type" => "close",
% ?# \& ^ U; }, l- K6 W( ^& T ),7 ?0 p f0 ^% A" Z3 a
2 z/ M( [. k) T# _) k) J( s! R
9 d7 G2 h! J1 r/ R3 ]2 F array( "name" => "Post Auto Thumbnails Settings",
" V/ p& Q4 j7 c9 ~, D# [ "type" => "heading",
4 x3 E, G$ y- r3 |; e ),
9 U2 @; _0 G7 l! p* E1 S
% z; Q$ q' |7 n8 u array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
1 a* \( f6 B* m. H7 @% c "id" => $shortname."_timthumb_activate",! P9 n, M# l& f0 p# k" W
"type" => "select",4 p/ S- I+ e% b8 c
"std" => "No",; k8 E% v" l$ v1 w. _% D* N* m$ b
"options" => array("No", "Yes")),
0 J! a+ r9 {, @( @7 r( r5 C / h' s- A$ N) ?! g6 m" l8 }
array( "name" => "If Timthumb is enabled, Please choose its cropping method",! w0 }- X; w" B4 B
"id" => $shortname."_timthumb_cropping",
" | Q0 D) c+ ]8 R' k% e' h9 I- ?" _ "type" => "select",, o$ [$ S7 B# s2 k; x7 r/ }' _ j6 ^
"std" => "",3 u" p& B& s& {) w9 a/ _/ H
"options" => $crop_position),/ ~: ~" k; s) `: @- O% C
; V/ g8 n: ^: L1 t" |' w' D; R+ p) l array( "name" => "Insert Width Of Thumbnail Image<br />% Q( u I8 d# ~9 P% K( S0 d, C
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />4 P2 `) {* ]6 V" l& g
<em>*Leave Blank To Use Default: 250</em><br />",
% r* o1 `2 L4 T$ b3 X( g "id" => $shortname."_thumb_width",% Q; L3 V R% T* o
"type" => "text",! Z Y" C4 t* ?4 I: P2 ] b4 B
"std" => "",) B, v: i' \+ h% E
),' ^' M( \, A, c0 o7 ?6 G" @1 K2 g
) O$ h6 @( v; ]" \5 a; M array( "name" => "Insert Height Of Thumbnail Image<br />
; I! t. E/ M2 a- } <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
3 x' w% X! M D M, F; P! L5 x <em>*Leave Blank To Use Default: 200</em><br />",
; |" w& a' p+ I% W "id" => $shortname."_thumb_height",
+ C8 e7 K1 ]& f7 E9 c% k+ [ "type" => "text",$ \/ Q% x. e" l. s$ [( E( V" \
"std" => "",
, @, H: U& d) ^* G" m/ T$ A3 G ),
7 ~4 |' \) @/ U x5 h2 Y, X- I; Z
: g5 @" Z0 E- `; H" F* K& V ]3 a& U array( "name" => "</div></div>",
1 O. E( N0 p% S4 D "type" => "close",
5 t( j5 I E& W ),8 v' F+ N& g9 l
) h( u* I8 n/ o+ y array( "name" => "Featured Content Slider Settings",/ x+ Z0 i. s8 y$ M7 R2 J' }
"type" => "heading",
. U0 `' K! C9 M' ? ),2 q' F- ~- [0 L
1 K$ R* B K% A6 L8 V) t4 S2 v2 X& x array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",: s' `. d, d! O' C
"id" => $shortname."_featured_activate",
* A) N0 I% i1 F, l "type" => "select",5 Q- @' Y. M0 {, ?3 |
"std" => "No",; n/ K0 ~7 E3 Y
"options" => array("No", "Yes")),
3 \" N. g1 P s# ?1 y7 W& @
0 X- j( H" |$ m6 @3 j! [4 t" T0 J# N9 _& T D) M
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
% S H, Y) D) `. R4 C$ ~. | "id" => $shortname."_featured_category",, e. Y) G6 }2 E9 {
"type" => "select",
, R" d9 E& n, T" c% Z; k% T9 H "std" => "Choose a category:",
, |& C0 K1 t- { "options" => $wp_getcat),
- F" I: ^$ E, u/ ~
B j7 N2 e) r( K2 P0 Y% Q array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?"," s: d, z* x- i' _, ~ E* Z& Z8 h
"id" => $shortname."_featured_number",5 S9 ^, _' w' c1 ~
"type" => "select",
! G+ K# `" H4 y* i" a "std" => "Number of post:",
5 s/ z" k) @, C2 j- D3 A* M "options" => $number_entries),3 Q4 @' Z5 H; s7 o
. E+ J$ A" D' F7 O C9 R+ C$ }( f- I array( "name" => "</div></div>",6 o8 y* S4 J- s$ w/ d4 c
"type" => "close",
. F& T& l( H! a8 t# m$ s$ e ),
2 A& L. @, g) Z, p E b, L
2 k3 O+ Y" B2 {! B+ { t9 n/ A array( "name" => "Featured Category Settings",
9 C' {$ G" p* p2 ]1 M* [ "type" => "heading",
4 ~$ X; u- j4 f& `) x( H9 ~ ),5 u2 r) ~* U* Y5 F2 z4 H6 x
$ }/ g# w; ^& J9 } array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) w) ?) A, L" d
"id" => $shortname."_featured_category_activate",
% Z. D2 {* ]/ c; J% f' I" k "type" => "select",
% r" p5 d5 A, O: a! w1 Q "std" => "No",
" K" d5 [0 `- X4 |9 C; M "options" => array("No", "Yes")),
/ f* {, Z+ Y( d( [0 H6 f {: _ 3 ]( R# y* {) ]; R
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
$ a9 `/ d5 `$ C# o* }& Z "id" => $shortname."_featured_category_id1",2 s) Z. ?" z9 B9 N! ~! m7 A; M2 X
"type" => "select",6 J3 [+ l( t9 Y$ @3 N
"std" => "Choose a category:",
! p7 A7 v8 F2 Y "options" => $wp_getcat),
2 H9 ?4 l6 {5 |3 I & V. m$ F( T4 i# @8 w0 |
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",% E/ y- e* i+ Y9 H9 O* D, y8 d! X
"id" => $shortname."_featured_number1",; {1 z5 x! S P4 Q3 o% t
"type" => "select",
: k1 f! ?/ c) T2 i* k/ u "std" => "Number of post:",% P7 }' ^! I' n* n5 h. p
"options" => $number_entries),
& L; y( h, f4 B0 w
7 ~9 e1 h8 I2 {: Z array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",# P( Z: B* w& K$ ?- Y& c
"id" => $shortname."_featured_category_id2",
9 {1 j5 a" {3 w) j( U9 A "type" => "select",
& c, H8 j" Q0 B "std" => "Choose a category:",) T# K M- f |+ n; Y/ ^
"options" => $wp_getcat),
) z+ L$ P8 {; l+ B2 b
* e) e9 g+ T4 r r- R/ `7 s array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
3 Q, `, a3 l. T) G2 Z1 R "id" => $shortname."_featured_number2"," l) V) V" W1 F8 C/ {
"type" => "select",! ]1 _1 @! C7 W0 ~( b
"std" => "Number of post:",# }' z1 e$ X/ E* q% a1 A- \
"options" => $number_entries),
: X0 ~3 n1 G5 ^" ?4 W8 h$ X( X $ N# R" x- }; a
* W' v8 E" h4 G, u array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",8 c% L9 }* ]6 O$ }+ L: d) ^
"id" => $shortname."_featured_category_id3",
/ E1 a/ b" O+ ^* G$ h: I! I "type" => "select",# g8 j: _" t; X: `6 W2 L
"std" => "Choose a category:",& d+ T: h. o- T+ N% \% `; V
"options" => $wp_getcat),
+ i1 o4 o S0 i
, }% E0 R1 r/ h- N array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",7 R5 _# N4 ?! T7 P+ ^7 |, ^
"id" => $shortname."_featured_number3",( a- i; @4 Z- v! Y3 V
"type" => "select",
8 n' C9 O1 y( `; |* p+ e "std" => "Number of post:",) L* n$ u4 m9 n8 @: d* f0 i) M! h
"options" => $number_entries),
0 w* y( V3 u" H3 H" @# w/ a. C
- a6 i Q9 J3 d: J: b$ p7 _: r( ^5 D
4 K/ {! Z. T% [. |7 V( N! v array( "name" => "</div></div>",
+ ` {. V/ ?7 w: `' _2 ` "type" => "close",
% k0 N" `- B( s5 Q, @ ),! \ \9 k1 [7 i( e% j7 `" C
8 p; y" n+ A4 X) \7 [% n6 w2 m
! z8 ? N* b8 t% k
array( "name" => "Google Adsense & Analytics Settings",; E( c( V. X% x
"type" => "heading",
$ J9 I, i D6 \ ),
9 {6 P) ]7 {6 W: Q6 h- K0 s
! b3 g/ s. ?. C0 \) d4 O1 g array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
, L! B8 J& G$ }/ g: ?7 U "id" => $shortname."_adsense_loop_activate",
! n. Y8 c' Z8 y# Y0 Z "type" => "select",# @0 O" B# R. ^+ F: j! n! m
"std" => "Disable",
! i- f; b; E/ Q6 V% m "options" => array("Disable", "Enable")),
7 e, z8 L2 ]% ^; [! f3 p# D+ N- Q Q' y2 u Q! `0 I
array( "name" => "Insert Google Adsense Code For Loops Here<br />7 V6 d* C, i6 E& q, ~
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
/ a9 ]( g1 g* q4 Z( C6 g "id" => $shortname."_adsense_loop",$ m& `: l* a \% k9 b
"type" => "textarea",
W' K! D' H6 u* C "std" => "",
+ e5 `0 y+ k8 w) ~ ),. c$ ~; p* N4 ?$ R M
3 C) V% f% r- q7 ] array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
- j, W$ U$ K6 m "id" => $shortname."_adsense_single_activate",
3 C' E% `/ k! L8 i+ w0 G* R7 w "type" => "select",
! e7 v. p6 R2 o/ y$ _$ Q "std" => "Disable",
/ l" f2 ~' D: B+ Q. U- K1 w0 H$ Z+ K "options" => array("Disable", "Enable")),
M* p) X1 F6 G0 [; N- h0 z2 H; N4 A! {' E' |1 c0 z# F( n/ g. U
array( "name" => "Insert Google Adsense Code For Single Page Here<br />! \: {4 \7 z h" f3 i( m
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>", O; U5 p; K; z8 b
"id" => $shortname."_adsense_single",
7 L+ ^# _6 s# |6 ]$ f "type" => "textarea",
; [ f3 l6 F/ h9 | "std" => "",3 G) h- @" Q9 f' N6 d- q+ J
),$ |2 [: x8 O; L! L8 c0 ?6 ?. \
9 o# c' K# C" ~/ r, U% e5 O
0 K' e5 g2 p1 L' U8 N/ i$ v& ]) L/ X array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
; L# @8 k- y7 d8 | "id" => $shortname."_google_analytics",
$ `4 D0 Z7 H9 a( K1 L "type" => "textarea",! e7 x8 F4 M2 r
"std" => "",0 ~6 r7 E+ U3 }: M. C
),
6 z5 }$ F" P7 E8 T# i: J8 }" R* A' f9 j% R
array( "name" => "</div></div>"," C; Y0 K; t- A% M+ ]2 Z- b
"type" => "close",
; O9 k$ V1 K# L$ c, m1 O ),# T, W: \# g) ~# [+ u! ~, Q
7 Q, ~ w j/ U/ H4 n
4 e# C" T C @! v6 R
array( "name" => "AddThis Social Bookmarking Settings",
) A/ }$ \: U+ Q/ o! X ` "type" => "heading",4 q% Z8 w. ?2 v
),+ w6 e( V1 X4 [0 s* x
; b: g' ]0 q7 p7 |3 C5 f: N! d3 C
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
0 @( d3 H2 g X& H <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
! g* X1 u0 b* O! f) ?$ L J "id" => $shortname."_addthis",
% d6 P# _9 }- i: x5 B5 a2 { "type" => "text",
& o/ u0 N9 a2 D4 Y: @9 Y6 [ "box" => "social",; [! g# |. q* A) V R
"std" => "",
7 r# J; I% w0 W' F0 Y: t: s ),
1 r- y; Q) k9 i+ H1 z/ K) n5 X6 I1 ~/ d. g
array( "name" => "</div></div>", Z: k1 n: c/ T. Y# ]
"type" => "close",' p# E+ i3 }* y: q
),
5 f" B+ \ ?, \# Q1 q9 {# d
& g8 d& A- [: n1 `9 U " D( ]. m. s! U& f% J- _$ g& U# W8 H
) G. S2 F( y4 l& u array( "name" => "YouTube Video Settings",
" K" ^+ C `- D( r "type" => "heading",- ?9 c/ \+ \# f3 d0 }- V" i
),
8 c& C( Z) i/ X$ p" K4 U1 F$ J$ {( o0 _$ X7 H
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",$ q! X/ P; r/ K7 K! ]* F" w9 j
"id" => $shortname."_emvideo_activate",5 ]8 S6 V) V b# M! u' {
"type" => "select",& N- D2 y3 O( j8 K3 Z
"std" => "No",& y6 `0 q {' Q, A4 Y
"options" => array("No", "Yes")),+ X% Z) s3 o% J- F3 ^
. m' |1 [+ b" E array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",; s4 \5 Y0 C1 A) |: {
"id" => $shortname."_emvideo",
5 r! [, Q ]' v "std" => "",' ^2 A% `4 L2 A9 ]. `
"type" => "text"),: m+ t: D( N/ ?" M
. x5 `' J7 n* M. Y7 E
array( "name" => "</div></div>",
: q! I: b! l; r6 |/ d8 B "type" => "close",+ u- Z' j0 e# Q x$ p
),
9 H; n* P! i- G# x" L. P' ^; g
- l, D7 Z0 P | array( "name" => "Twitter Settings",
( \' w; c: p* U( g p! z" z9 W "type" => "heading",
! E7 k9 |" ]% @ ),: i" Z$ S% \- p
5 \, B) Y" \" |9 y: x. }
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",+ P& C: ~3 Y# h' _0 R7 C6 p, \5 {
"id" => $shortname."_twitter_activate",. [+ p) Y2 `% v" N o: i- W6 S
"type" => "select",+ l# D e- i% E" Y/ j7 {# x5 ~
"std" => "No",
( y$ s' c- d A1 R1 B9 U "options" => array("No", "Yes")),4 Z# z- ? M. p! v
1 W$ o8 \7 ]/ d array( "name" => "Insert Your Twitter ID here$ |0 z$ F- k7 K S
<br /><em>*leave blank if not necessary</em>& p8 ^2 |% H6 M* D* L
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",, E* g8 x( X- Q: x* [
"id" => $shortname."_twitter",3 ^3 o$ P! _9 B# L4 T. {
"type" => "text",: U: T' u! u' x( l& H" l4 I u
"box" => "social",
& |+ Q# h% ~$ ~; Y7 }" ^0 o "std" => "",
0 q! Z; l/ e/ M ),* U% I& g; N% _: |6 X+ d% Q
; B& {& j3 E4 N9 ~ Y
array( "name" => "Enter Twitter Feed Count here! @. `! P3 r) F: C6 X
<br /><em>*leave blank if not necessary</em>
, D7 \7 {. t: U5 d0 l2 J& w <br /><em>*Enter How Many Twitter Feed To Display</em>",
: l' U+ c; f$ E! k; L "id" => $shortname."_twitter_count",
: ?7 ~( d+ S/ ` "type" => "text",. M8 H0 R# G+ u! L2 q3 v
"box" => "social",5 ?% |& K2 x7 D; ]
"std" => "",4 S& G' z/ F9 k
),
) C& L/ n: j) G
# h& }3 ?5 y& y5 r3 { array( "name" => "</div></div>",, ]; y. L# Z( ^ y/ E( M* U$ y6 k
"type" => "close",1 k' M* A% [: u2 t5 h
),; s5 v- Q2 H: h. q1 S
4 h. t) A$ f6 Y1 \8 N9 T# x
9 |8 O5 u% x) O: ^7 G' N array( "name" => "125 x 125 Banners Advertisement Settings",) s% e# E2 C- C2 U. s
"type" => "heading",& b3 g/ M) d+ ?7 O3 H7 U9 H
),
7 i7 h- c) O5 V- S1 f
! Q4 {7 @& M/ }1 p) }4 C/ ^ array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
; _, x4 p6 @4 U7 h P6 j "id" => $shortname."_sponsor_activate",# C; m* q# k* `: k$ U% f
"type" => "select",
8 Y- T, I8 r" e3 C7 |3 L- k. F "std" => "No",- e+ m7 q2 ?9 S9 C
"options" => array("No", "Yes")),) \0 H, M/ h( ~$ V) H
# R$ A$ G( Z0 } J7 Z8 Y- M( c- B& R$ U" a) K7 N' Y! h6 @
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",) T3 L y4 X* C7 p9 T2 n
"id" => $shortname."_sponsor_banner_one",' }3 M7 i2 s4 n% b0 P% q
"type" => "textarea",
8 `& r( \2 G0 H2 Y "std" => "",
2 {. Z8 q! a' |! T/ j ), 3 U* {7 G4 e* B8 |/ B
* |( f: x4 L6 [; }% T7 }: \ array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
% z3 |# S. S6 t9 q* j b1 K2 n "id" => $shortname."_sponsor_banner_two",
3 d$ C* i* x X) s- j- @" Z "type" => "textarea",1 A$ x1 E% V! K2 D. x
"std" => "",
1 i, G y% T3 F! [& V9 i# a ),6 T2 k5 p9 q) W9 P
. A/ ^6 ^. R4 X8 g- M) t" h! b
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",! _& e m7 Z, T) c
"id" => $shortname."_sponsor_banner_three",
4 U# {2 I4 d: Q9 S "type" => "textarea",
+ j/ j9 D! R }. I "std" => "",
% |5 ]5 J' ? G/ o0 p' L5 b/ X# K/ j ),% U j* @+ C5 Q
& ^0 A1 h7 ^) T6 D' V& j& F array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
, w, m3 t; x7 X+ C/ h; T4 p "id" => $shortname."_sponsor_banner_four",: S% g# z: q. J6 K; Z
"type" => "textarea",% O3 o2 p3 {% l6 e- Y- Z
"std" => "",
; p. A$ L" {. n7 r" x6 n& G ),9 k! a$ Z: i6 D: M, P" G6 f
6 [# ?1 [ H9 P |
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
0 D7 I5 l- U2 b. r* }. A "id" => $shortname."_sponsor_banner_five",9 I- o" ^! |8 r7 v. U, ^/ a+ Z! ^9 k
"type" => "textarea",1 k% y% U( L* R% N' }
"std" => "",
; X4 b4 f3 g$ N& U1 a; b* e ),
3 |( ^, c& ?" B- l5 b' O) C. p# U* ?7 e. ]: {
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",/ E' m: R( P0 }, d+ v4 O$ I9 O
"id" => $shortname."_sponsor_banner_six",1 z! d* `; Q0 w
"type" => "textarea",& ^7 x& J1 T& _' }4 x* D5 n* |
"std" => "",
) T1 X+ N& o. Q ),
* _- T! y4 x: t& o: d) b! X; ?. @5 W+ `/ r- A' V1 T E$ ~# b" R2 B
array( "name" => "</div></div>",
H n+ [; c! I/ ?, p "type" => "close",# X' [7 F" w" A2 z8 n% n
),6 ?7 ~5 d) r9 h5 S: i0 o# X% m- N
7 Y1 ]2 ^9 {! W/ ~
y7 W# H4 v+ G0 C7 g
$ g5 o9 O! F% w( ?
);
3 T) y F' V" Y K6 S0 V: P. g: ^
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {. v& F# F8 e- V$ j
1 p6 V$ A& g$ N0 D) f) R1 p( U
echo "<div id=\"admin-options\"> ";
! E! o& `6 @* w6 [8 x/ ~& z2 Z; Q
global $themename, $shortname, $options;! c5 x8 P4 l( s$ S
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
^! J: {+ Q/ X9 j$ I: Lif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';! Z4 a3 b/ Q" K# ^7 t- y6 b
?>( W( D: f( x8 Y7 C! k
. K4 B0 K' g0 r
<h4><?php echo "$themename"; ?> Theme Options</h4>
8 h: [1 T1 W! l3 T, }' H6 b1 l0 J3 j3 p2 G4 C& Q+ \7 o: j
<div class="annouce">
l+ X+ U& d9 s- L<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
8 Z% \8 Z. P7 e# U! l; s7 o6 m1 S6 D" W<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>+ B) I( ^7 ?( _# x0 D3 w9 S
</div>
, ?7 {7 `3 @( B8 \/ @( s/ I1 l' j9 I# j$ k
<form action="" method="post">: K% T& ]2 G( o( }: q, X
8 w) ]0 p( o1 h' \) I! R) R8 `
<?php foreach ($options as $value) { ?>
8 h/ Q" @" d3 _% E1 K) s2 `$ I+ \6 i& S
<?php switch ( $value['type'] ) { case 'heading': ?>
/ m* |5 Y8 ]" s% J7 M, `/ J* A k2 s) A% o
<div class="get-option">. E O" [& R" g7 }( U3 ?9 H
1 f4 S# d9 n' U! X/ T
<h2><?php echo $value['name']; ?></h2>
+ z( [. [9 U9 }/ R) o, L% n2 Q+ G6 F' m) F0 c3 r e" s/ r! A
<div class="option-save">
$ `6 _2 X( [ T
; T& D1 \ h: I<?php
2 H; t5 U; w! h* D. L8 dbreak; \% [) P0 j7 D& C3 q
case 'text':% g( m3 Q' y6 ]
?>
8 m: ~" d, o+ V- I; j& F
( [* C8 L6 y4 u6 b6 i<div class="description"><?php echo $value['name']; ?></div>
9 Y5 o9 K, N @' X) S1 Z) Y3 D<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
8 W* c' f- ?2 _$ k$ F5 z+ y' t: f ~9 ]
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
% A# _1 B( N% E. ]3 q# i; s- N. j; Z+ o3 \
<?php
8 s0 p2 @: K( a& Dbreak;
1 |9 t# n' Z) n" |) G9 H. hcase 'select':) K7 E' q& I! B4 W3 q; b' D
?>) _& |, y9 i: D0 p& w9 k
( K2 ^+ N! Y* U" D" w<div class="description"><?php echo $value['name']; ?></div>
1 R; `# @ s4 q$ q6 b* p<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
. z; N. p5 q, X' {2 W<?php foreach ($value['options'] as $option) { ?>0 L% n6 L/ B$ h. H
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
( u' s9 l$ L4 ?9 {$ a<?php } ?>. ~# s4 M9 S/ L% ~0 r- W
</select>2 n8 F$ n9 [+ C$ }( `9 L
</p>
5 P, d* ~* ]0 M# [
8 X4 T7 T! W, _0 n, a5 y0 c<?php
9 b; _+ h( @6 J+ {8 Kbreak;
5 c: H6 P; Q& C+ o# n2 F- Ncase 'textarea':
: u- H) |8 l2 Q w2 w$valuex = $value['id'];
) A b* @4 ]1 o, l0 @! M. i- U8 c* U; z$valuey = stripslashes($valuex);
7 k8 v9 `& |# N) o; j$ m6 S$video_code = get_settings($valuey);
; l3 J8 C% `$ N0 N?>8 v% ]6 g7 N6 F( k
0 v H1 A, H& d# ?<div class="description"><?php echo $value['name']; ?></div>
8 ~4 R2 ]; z" D J1 ?7 G! c/ x<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
* s$ g* n: G* \4 |' s5 I7 D n' C \4 _% E6 X4 D
else { echo $value['std']; } ?></textarea></p>
# c4 U# m& E- ? E+ Q2 ~0 z1 d. {, M) R, a8 x" _
<?php) i. K1 [# ]. |& C, [( U% ~! Z2 B- a
break;
/ x f: _; u2 k6 `! [& X2 k+ w U, Icase 'close':7 n0 J5 _4 @' S! H9 y# ~
?>
! H+ t6 Q! k6 N9 I" h6 I+ W# P, K K+ Y" x! F
<div class="clearfix"></div>
$ n' q4 ?4 X3 x& H" o</div><!-- OPTION SAVE END -->
8 {+ L A# q$ \! @+ p2 m
9 z! Y, L0 V3 F. y2 D( y0 b' T3 b( i<div class="clearfix"></div>
, ~$ q+ ^. a/ A& X |</div><!-- GET OPTION END -->
l) k+ n7 _% [
5 U5 }7 T3 d0 E<?php# t0 L7 Z9 a: x3 D4 f, m4 H* j
break;1 n0 W. k( Z. Y* G8 ?
default;
& O) G: O+ W% m( V?>
1 k6 c; ^3 t# V* F
" [" ~) C9 V: p; f8 I Z5 E% }+ B) L
<?php: d/ ~# b' K- i( w
break; } ?>
c3 h: j! x+ ]9 S
. [& Y2 Z! m* t* H) ?<?php } ?>! t, W' ?2 @2 J3 c. v( ?
1 h6 ^1 r8 O) D+ J0 D
<p class="save-p">7 W7 ]3 a, }* P
<input name="save" type="submit" class="sbutton" value="Save Options" />
5 q7 X+ I' _/ f/ v# A4 T<input type="hidden" name="action" value="save" />1 E1 @9 z' w* G' {; J
</p>
3 W' ?! X4 }/ p$ g4 o- D</form>
( v! Z+ D- e3 j3 N# D- x5 r; [ n$ {4 a, b# {% b
<form method="post">
* h1 f; T& k8 p2 |9 z* J- C" ~<p class="save-p">
& w7 q9 Z9 J5 I<input name="reset" type="submit" class="sbutton" value="Reset Options" />
/ i* t! ^3 E% ]; K2 R<input type="hidden" name="action" value="reset" />
; `, ~1 m. B! J" u" ^</p>$ r: C+ w9 h) ~4 [- i" c0 G
</form>
$ U6 V( R! q+ N* Y( S/ K5 l3 r" ?( Z- T
</div><!-- ADMIN OPTIONS END -->
! s6 L3 C) S1 y7 o0 x9 [# B, l% _( ~4 A4 g' l$ a. o9 j3 V
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
: b* x4 S+ ^$ i; m
& j2 N4 Y' j$ p4 U, x+ w, H& m2 [' ofunction mytheme_admin_register() {3 {, d' w0 Z% S ?
global $themename, $shortname, $options;
) o7 D% a" k# A! t3 G# n1 _ Sif ( $_GET['page'] == basename(__FILE__) ) {
3 u. Y) I- u9 K0 `4 |! j- x8 Bif ( 'save' == $_REQUEST['action'] ) {
7 k& u+ ~' k' n/ @foreach ($options as $value) {
$ R* ^; Z0 n3 gupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }, d. e9 _. S ~
foreach ($options as $value) {" t8 u. e6 ~3 T) n! c( R3 t
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }, K' V8 r6 T' D
header("Location: themes.php?page=functions.php&saved=true");& l: @) o' z# y/ `
die;
j, @: p- x9 b9 [& @} else if( 'reset' == $_REQUEST['action'] ) {
6 b+ Y; _+ H$ r! k5 ]$ ~+ p& Aforeach ($options as $value) {
0 I) D$ x( o5 m" N% hdelete_option( $value['id'] ); }
2 l6 Y, K) A0 V% Zheader("Location: themes.php?page=functions.php&reset=true"); K0 m8 U* N% y6 `4 M$ \( v
die;8 k1 b& `$ w; K+ p& \. W& L
}
( Y4 O1 ~1 u: U' B0 G Y/ v}
* ?9 p0 B- ~. w" K( ~+ P0 }add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
/ A, g0 b' @3 Q8 t}! M( ~; I! S& V) J6 ^9 q6 t u
& H0 W1 E3 [" G: I7 ffunction mytheme_admin_head() { ?>& L" ~+ y8 i$ B- H& B& {
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />* U/ B1 V5 |1 V8 _
<?php }
. q. O1 d: k( A; ] |
|