|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
3 A6 u \6 O, L+ O) z" i0 B// Theme Option5 M! w7 e7 z; ^! J
////////////////////////////////////////////////////////////////////////////////+ I8 u4 M: ?: p& Y
! L! x, E# j" J. y3 o$themename = "Zenx";
* y+ g5 q3 ?7 s( n/ [$shortname = str_replace(' ', '_', strtolower($themename));2 _: _! Y% X' W
' |* p2 _/ ]% q" m7 e$ z$ c. ^1 ^1 `2 I
function get_theme_option($option)
/ B0 b: M8 o. K% v+ }: K{9 C/ F; J$ e! U; F0 m
global $shortname; ] u' u6 F" D- X" [- {/ c
return stripslashes(get_option($shortname . '_' . $option));! u! @: T5 T' c) x @
}
4 Q" Y* \! f4 O7 P7 ^
" t! n* u/ l' E+ S& Efunction get_theme_settings($option)
! Z- F+ E- D: B, b0 b/ e! m{
- _, q( O- C* }5 H% [; m3 A return stripslashes(get_option($option));
7 \* S1 _* }8 Y}$ N& Q0 [ l! i
$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");
: [& B! B( D8 ~& M: i/ P& k$wp_getcat = array();- I( I9 C7 k5 Y+ T3 Z
foreach ($wp_dropdown_rd_admin as $category_list) {
4 i' W, j! ~; o9 x3 Z$wp_getcat[$category_list->term_id] = $category_list->name;
# n: a( P( M( c6 ~$ n- f: R! t# Z}
0 ^5 m/ B7 X' N" o0 o. W$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");8 D4 C- e( h0 V- \
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");6 M& W, k" e2 C7 r
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
, m7 h; _3 ?, u, C" |0 p. e( {
6 s2 Q. l% v2 x& i: p0 p$options = array (
8 o: w! E9 _2 b: A$ g. N, c0 O) i2 Z; w( G" h% k( O
$ v; n2 y) l' L7 j8 M& I7 c array( "name" => "Blog Header Settings",
8 d% z# x. m/ z+ B% ]+ c* U; B "type" => "heading",
| i6 W/ |1 `$ M2 y. Z ),! ]9 ~. J/ ^1 ]5 _! y/ h
0 P. q% L3 l3 H, P5 @0 w& w# h
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",0 d' c) x( S* O$ j5 c% r' S
"id" => $shortname."_header_logo_activate"," Q9 v% c" _: _ m7 ?7 S% h/ D: P
"type" => "select",# t; w- j: W# F
"std" => "No",
3 {* u. f+ r+ J& l( v "options" => array("No", "Yes")),
( d9 x0 [5 I0 d( c6 ~3 v2 H: t6 z8 t( J) ?! l7 A
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",+ s1 T/ j B& d0 U0 X, M; u6 U' U
"id" => $shortname."_logo_url",
& i8 i, P/ C- H; Z+ a& |0 I( [* P "type" => "text",8 L V4 P5 W' s* K# a- l6 m% J) ~
"box" => "social",
5 Y% q7 V3 {' Q( C( x "std" => "",7 }7 U/ ?1 o1 I* Y3 \7 o1 }
),8 L- h. u! c, ~. {- b
+ i9 ?* r1 i$ w& g3 k6 H2 J4 F
array( "name" => "Insert Header Banner HTML Code (Header)! c; }8 C& n. J$ k7 ]4 D* y* l @# K
<br /><em>*Recommended Size 468 x 60</em>
1 o* ^0 }' {. } <br /><em>*leave blank if not use</em>",
+ f! I4 x6 M! e, K "id" => $shortname."_header_banner",# ]& a" w/ D6 S
"type" => "textarea",5 w) o& g1 X/ J& l5 M
"std" => "",6 e1 d' u2 \, y; k- A' [% {
),2 {0 {5 ~6 Q7 @7 W5 _' Y) ^ `
+ m3 { q* D' c; R8 r5 Z$ p array( "name" => "</div></div>",
- b( z* m) M V6 {: T. A "type" => "close",3 S& y6 F' s4 l3 N5 z
),
9 W$ Q: ?2 ?4 V. }' R0 \ C9 M6 z, p3 k/ ?
m" e# }: F( x. _( ?8 T6 V array( "name" => "Header Navigation Settings",4 x) M3 {9 I4 w0 m4 Q
"type" => "heading",
) Q% B: S- m! ^- H e( I ),
y$ ?7 B- r7 y8 ^& ^* D+ i$ d* r0 m& [+ c
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />( L! f1 [3 m/ Y* d$ }5 a4 v
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
9 R7 g- E: A. _4 L7 e. E <em>*Enter the page post ID number only</em><br />' Y! \2 z9 a0 z
<em>*separate by comma</em><br />
: R2 V0 w4 K" t# O i+ d% t <em>*Exclude pages which you don't want to show on the header navigation</em>",. t: K* c- ^4 U7 ^9 d
"id" => $shortname."_header_page_navigation",$ w$ O* [3 D; T1 a# M3 b
"type" => "text", O2 w' `1 \6 d9 v- v' P& m
"std" => "",
1 z! h; z9 l6 H8 q4 K/ { ),
' U! P3 L; j, s0 @: j( z$ e8 h& d/ W, y1 [
array( "name" => "</div></div>",
; u( H1 a7 i0 m "type" => "close",
# p) O& M8 K0 p% ~9 T6 H ),
" X' s& M4 j0 M+ C5 ^1 H e2 G+ m3 c2 k6 j2 F# h0 _
7 U4 Z$ [% N \
array( "name" => "Post Auto Thumbnails Settings",4 s0 D9 e+ t1 i2 c/ F k
"type" => "heading",, f5 Q9 `& h2 Z% `
),) ^5 X3 b- E, E& F0 L/ j, h+ Y
. Y: Y e: L6 `$ |0 O: E0 k array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",7 Y! ^$ O5 y* P) w$ G
"id" => $shortname."_timthumb_activate",# p* \ w7 w7 C
"type" => "select",) u' l. a/ C! }6 H1 G. P
"std" => "No",
3 b$ M2 |, j+ J( A. b' G "options" => array("No", "Yes")),9 p+ D7 r' C& U/ v
& u' h9 W& u& J( q" L) s8 _# F
array( "name" => "If Timthumb is enabled, Please choose its cropping method",* B7 [2 i4 @0 u L4 V' F/ I* s2 U
"id" => $shortname."_timthumb_cropping",$ A: x/ @( _, ?/ N: t f! U
"type" => "select",9 b6 L! a& a9 N0 U1 i4 Z
"std" => "",
3 U* _; X& R) \% N- I( k# N "options" => $crop_position),2 g- A: I W4 d6 B
0 K( r0 G7 V9 F5 q array( "name" => "Insert Width Of Thumbnail Image<br />4 n4 }# s0 U$ r z* _
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />; y. e+ E% j1 d$ J9 X
<em>*Leave Blank To Use Default: 250</em><br />"," ~/ f$ `9 {7 u% n. P3 O( ]
"id" => $shortname."_thumb_width",0 X& e/ _3 b5 t9 R4 v7 q
"type" => "text",0 I; u* r6 d1 Z
"std" => "",
+ H+ }4 x, C9 }! n" |+ t$ g ),! O& d5 q" Z' u
; o. a- \! \- D2 K8 v7 f array( "name" => "Insert Height Of Thumbnail Image<br />
% D9 V7 e1 o n3 O/ e( @3 a <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />5 g" r3 h$ k1 P0 B
<em>*Leave Blank To Use Default: 200</em><br />",
0 N4 U# _( a, I3 m) z2 ^ "id" => $shortname."_thumb_height",/ S* l0 q) c4 T9 a9 [6 {( ~0 \
"type" => "text",# J3 Y/ ^# G, p) h7 D( \" ]
"std" => "",
, n/ Q2 }+ P) e6 y3 _: h, U* i ),; l* \3 [4 C0 X/ n* s h
8 `" [6 {$ \; ^6 o d. v array( "name" => "</div></div>",
5 w& K% e+ r% l% {, x6 k "type" => "close", D, M! @, J9 j! V5 A% t8 A
),
! Y2 h2 b, W5 E* A7 U1 ?- s# G0 k' P0 R( m, Z+ @( a& Q) b
array( "name" => "Featured Content Slider Settings",
! h5 i9 \+ E; q: ~ "type" => "heading",$ _ Y7 O! y' N) J7 m
),1 E( |" t: H' e- ?0 H0 N: T
7 X. D" l. x0 D! p/ `8 o$ z4 f array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% R+ v, O( Z) P9 U# E+ D' j "id" => $shortname."_featured_activate",' p# x- {! K( |7 L, G
"type" => "select",6 Y8 A2 n; N1 w5 l& `
"std" => "No",
6 A z K- A0 y4 W* }4 ~! r+ p. `; V "options" => array("No", "Yes")),3 o8 w3 x3 C! u( h
- E5 Y+ ]/ A) F, q( B7 k
" f8 ~- ?. [! T7 S" u( m array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
- ^. p8 B* u/ e2 [% ?( E9 G# Z "id" => $shortname."_featured_category",
$ Z! ~1 [9 V. m0 Q8 j "type" => "select",
1 S( \$ C0 ?# c8 @ "std" => "Choose a category:",& P( K' V! s7 `
"options" => $wp_getcat),; O' b6 S0 a, j! i6 \6 J
, C% K4 ~1 E1 L8 _' |" H s
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
! r4 l+ c0 X% Y% k "id" => $shortname."_featured_number",
! r5 h: p2 Y9 n( `: G "type" => "select",- H+ H* e' S9 E% {# }0 p* a" n
"std" => "Number of post:",
- S; b; N j- Z0 u "options" => $number_entries),& O9 z5 M+ m$ R! d8 O' p4 s; L2 n" a
% n/ e! x/ A1 j! [ array( "name" => "</div></div>",9 ]$ x; c( E9 t, D- o
"type" => "close",' N( a Z/ p w V, }( X; m
),
8 N) h( ]: z% X6 V8 M 5 b1 @4 F/ L8 s! S/ C3 K" S
array( "name" => "Featured Category Settings",) u8 P3 @" T1 t q4 [
"type" => "heading",
+ Z! _: i4 X# F4 R" N& f ),
* Q% h9 _5 B( D* F; t7 }, L
& Y' Y0 U5 c% a9 [- a! F. ? array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
! }- ^0 B( Q% f "id" => $shortname."_featured_category_activate",
, |& S. p; y: w, M" N! B7 J5 J3 f "type" => "select",8 p. T. B8 k, ]- S& n* g
"std" => "No",
# ^- T2 b3 ], u! [% ^. F& K "options" => array("No", "Yes")),8 f6 d. p0 P M4 B U
& {7 j, H9 K- U) f5 z" D! k) {
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",( K7 k' ]; S3 T+ J" o1 C
"id" => $shortname."_featured_category_id1",
2 W: {/ u8 ]1 y7 M" C2 a "type" => "select",
: ^2 k6 p9 G% J( C* A "std" => "Choose a category:",5 |/ f+ U; D7 @ x
"options" => $wp_getcat),
+ ^6 j8 k7 o( C$ J 1 N" Z! l1 x. [( t$ ]' u
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
) S# {2 s9 K" L& D$ L "id" => $shortname."_featured_number1",
7 u# f. s3 `" H2 Y# B$ ^ "type" => "select", A# Y) e/ ~6 D3 h5 j0 X
"std" => "Number of post:",
( X7 ~/ m/ P' C2 w; q. z2 z. a "options" => $number_entries), t( C0 s# |. k& O0 T- l; {+ ~
, B0 Y! Z5 Q8 ^( M
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
" m; P4 p$ W, s9 V% G "id" => $shortname."_featured_category_id2",
& ~+ \( L `: `" r5 K0 A; k "type" => "select",) N7 u, _4 U/ @5 K) N
"std" => "Choose a category:",( _# `5 e( i- ^+ u' F2 S
"options" => $wp_getcat),
. P/ t, s5 d# M* H- @: E% j
6 ^+ g {5 z# Z. a1 o( W array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>"," \+ c6 ^* z; l4 T" b
"id" => $shortname."_featured_number2",$ y; Z6 f p. a) p/ [) i6 N% K
"type" => "select",
: \" r1 |5 }6 D a2 ^ "std" => "Number of post:",
7 t1 ^: `" S1 I1 ]0 c7 n "options" => $number_entries),
5 H3 Y) B$ |- t7 H7 B
q& e' {4 k6 J& }: C 4 x0 x b1 F4 ?
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",9 G! M" P2 m' P- }
"id" => $shortname."_featured_category_id3",. X1 J2 l" O0 q8 U
"type" => "select",
0 Q q) r6 l3 u "std" => "Choose a category:",
" N- a p$ ~+ X6 a8 z: k: j7 A: | "options" => $wp_getcat),( v, C" a# h! x3 z$ ], V, C
" j# m% A: j" L( X5 o8 P3 Z array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",+ o3 z& k, D4 u* q- I, O
"id" => $shortname."_featured_number3",$ d. x5 x, t& c1 U1 n; ?) S& V' `% [
"type" => "select"," Y e8 v# A: ]: o
"std" => "Number of post:",
" I* x" ~$ d( j- I$ C "options" => $number_entries),
! W: _' W2 h. w6 u" }. b& n* k5 k$ q* g
* z$ g' N8 _8 M: P! x9 f
, r( f8 k# P. |" ^4 }4 M array( "name" => "</div></div>",- |8 }* G/ A5 u9 D* G: @
"type" => "close",
3 ~9 [9 ^. U. s# g6 }9 {8 n ),$ q8 G! S1 c6 ~0 Z ?7 o
, Y" _7 y7 U) b! P; l8 c2 a+ W7 k" l# M h& B
array( "name" => "Google Adsense & Analytics Settings",0 Z; O9 c7 {3 @7 @( y+ A4 t4 E
"type" => "heading",
2 ] ^- |9 L- e ),
" A2 A) w1 Z7 X
+ ?- K; R! }: q array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
8 R- K- G, Y ]" x; |- v "id" => $shortname."_adsense_loop_activate",
" J! n2 _6 T. U) q( z" a "type" => "select",
$ _% E+ E* x* f) Q; _ "std" => "Disable",
& a! U) R. G" D$ u1 Y( M "options" => array("Disable", "Enable")),6 m m6 H- o3 f+ [# U* W
9 p3 k' v' O! `7 \
array( "name" => "Insert Google Adsense Code For Loops Here<br />
; e: ^! v8 p5 s9 {1 v <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",( x) `: b( f/ p& T" A# k
"id" => $shortname."_adsense_loop",
! I" |1 \ g% }, b/ m; `" C$ J "type" => "textarea",) e9 f! g) Q3 B& p
"std" => "",5 `# q x Q9 m" _3 i; O, v( c$ k
),
. n L2 p/ K! E8 O% t9 ]9 C: P S) V+ t* m* C& i
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",+ r& k% i. Q. T$ ~7 I
"id" => $shortname."_adsense_single_activate",
+ Z" X* W+ Z$ P% F1 B. M* t "type" => "select",0 r7 C5 X) ]; Z7 i: M
"std" => "Disable",
' [0 s, E9 m3 M# P6 f1 m9 t& o9 w "options" => array("Disable", "Enable")),
* a: W7 @+ I; ]# V" i6 o+ ?. a& L! o1 F! {5 `6 W# @
array( "name" => "Insert Google Adsense Code For Single Page Here<br />0 j' |$ X' F; K9 k0 T! p: h' d
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
: u% v# f6 E7 c$ t0 W. k# O( n2 z "id" => $shortname."_adsense_single",
2 n0 c3 f! F( e! L2 s! o' P "type" => "textarea",) H) w3 Q6 R: i
"std" => "",
" ?) [' i1 F Z. c ),
; K: i- o" w* v7 ~9 B- D9 Z
- I5 V4 x) s8 X8 I! v- {3 u& z5 ~6 w! F; L# e) a
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
* {# E' v% V9 u& H- q "id" => $shortname."_google_analytics",
" b/ _. Y" X& o& h& ` "type" => "textarea",
1 r* Q: e* c, i9 I( J- R$ v) v "std" => "",
: b$ ^2 B$ p6 H2 [ ),8 J# Z- i% p8 }( r, |5 _3 C
; `# p7 M, n, n* S) d4 s
array( "name" => "</div></div>",
, g' z( w7 W+ i- p1 y "type" => "close"," V" E j* m/ m3 L/ o% \1 ]
),
* [! y6 _" E9 O' L' p. F9 h
8 ~' @* ?4 {' E+ Q3 @3 e- R
8 E+ x/ ]- h9 _, g5 _( f3 _ array( "name" => "AddThis Social Bookmarking Settings",
! M9 H" i) G) ~. q0 ?* b "type" => "heading",1 ~9 Q/ z, f# W: l
),; ^3 l, A$ S" r4 l
2 q Z6 {9 Y( S0 p
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>$ e; h) A7 @+ m2 P4 U) _- z
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",) |, j4 J6 ?$ a* g# M
"id" => $shortname."_addthis",7 B" ]8 I7 M5 p, p0 O; f6 q3 d$ \
"type" => "text",
, C d% U: e0 W, }& N) j "box" => "social",
2 F0 \1 W t# L/ y# h "std" => "",' M$ h9 p4 i, e" ]7 Y4 t
),
% O$ { a) A* q% }# s' g
8 ^3 C, ?8 [+ r9 f array( "name" => "</div></div>",, H5 U {& }0 {% ]8 G1 q/ }& B$ W
"type" => "close",1 C, t; Y! D( s0 z
),
2 O8 h" u* m3 ?& P. w * F) B8 r2 |* R( Q( m, N
6 q5 Z9 b2 o% p4 u/ Y' {
! H* h/ Q. A8 E array( "name" => "YouTube Video Settings",, \; h" D+ I! e; f
"type" => "heading",
( N$ n9 A: V a ),7 r; h* v& Z) c0 v# b! k
% D# I8 |) m+ x5 u2 N; R; B array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
' n) p3 @5 c4 N "id" => $shortname."_emvideo_activate",
! _' Y. @5 E4 B: t! ` "type" => "select",
+ y0 p$ ?; }: w "std" => "No",$ A; x# B: u% Q: w0 m; A
"options" => array("No", "Yes")),
/ N( U! {+ s M6 P' P( Q. H) m$ Z( a
& o" ]( O! \$ Q! Z 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>",
( D: d1 R: {( j1 H! y "id" => $shortname."_emvideo",; X8 v5 g# n9 V' q) x
"std" => "",4 V1 e% V5 M- T/ V. @# S6 Q* k5 }" C* _
"type" => "text"),2 q& F, X9 M1 q/ i0 u9 j# z
7 I4 t% W% `! T: { array( "name" => "</div></div>",' S" @& u0 p1 c9 b1 E8 _
"type" => "close",
: Z) ], L8 k3 U& l) I9 H; l ),# \9 F& X, }" `) D0 f+ g
2 ^8 g1 |3 |9 M [/ [0 g2 G6 g array( "name" => "Twitter Settings",9 s: s2 W( ~$ r) U
"type" => "heading", [5 K: i& n7 b
),
, O" w! {% ^! [9 V9 r* S4 R# j) w C! l
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
* Y+ S6 c% u7 z$ v# F "id" => $shortname."_twitter_activate",
4 `+ P- S4 {4 L. o1 H "type" => "select",0 s' }; k( h0 |; e$ z
"std" => "No",
" p A, {: }8 @6 U "options" => array("No", "Yes")),( Z2 S+ Y: G" g! [: q0 T: t! i. N# h
0 F5 O; \/ a8 |* b' K. ] array( "name" => "Insert Your Twitter ID here
" z8 v3 v- w7 D$ s$ H$ m <br /><em>*leave blank if not necessary</em>6 `7 N, B% n9 L0 d. x
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",! [9 z: y/ s9 b1 {8 G
"id" => $shortname."_twitter",9 t2 H9 o; X0 `
"type" => "text",& t# P) }4 \1 E7 I! @
"box" => "social",% r) a2 @% |7 z$ A
"std" => "",- F/ X5 }2 P) Z. d2 R5 z6 |
),
8 M3 v. s3 w4 q
, S+ v# Z/ F, s0 L D array( "name" => "Enter Twitter Feed Count here8 B( u& a" k3 M& }5 V& y+ R1 p
<br /><em>*leave blank if not necessary</em>0 }: i3 W8 h {8 \& [* t
<br /><em>*Enter How Many Twitter Feed To Display</em>",
) \/ w8 C7 x C' c4 L( n4 f2 _, L "id" => $shortname."_twitter_count",
; U" |+ C" @5 {! d. k( ?: K3 y; D3 ^: P "type" => "text",- f! T, {% y3 K: Y$ A
"box" => "social",
& A7 a* l8 G3 Q, T" T "std" => "",$ ~# g) \; W# `' c
),
. r) E, w1 h( X
6 E/ p2 g3 x" [9 k% M* R array( "name" => "</div></div>",# V( F5 ~- b5 s6 S* i: B/ j
"type" => "close",, N _* [7 \- W. |1 U3 S4 g
),
! w6 N. v3 S, B. g- X
7 }% h6 f( X0 l0 n8 _ Y
* h, p* A3 N4 U1 g$ I3 A& V# C array( "name" => "125 x 125 Banners Advertisement Settings",
6 ]1 R# K7 q# M0 s6 ^ "type" => "heading",) G; J3 U7 t8 s; S& Y
),
/ s. x0 c6 a+ _3 U6 T2 ?
! I5 t, G; q R. N array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",& ^5 O5 I1 x1 D
"id" => $shortname."_sponsor_activate",
* O, _, j) G2 F/ j "type" => "select",: u/ Q9 U( t) x1 M% G
"std" => "No",
S# x" d: |+ j% t "options" => array("No", "Yes")),
; { }: _( z+ N4 w2 |0 p
0 T( J6 v; \' d: U
( s: J5 n2 D& F, r0 h" B array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",; U; N' E0 B, j# i9 C6 ~ O5 }% u7 t
"id" => $shortname."_sponsor_banner_one",
& f/ {) _6 f/ \ k "type" => "textarea",: |2 o1 o. Y( R1 h9 f* F
"std" => "",
& M, J `! K( ]7 u6 P- @' A ),
2 ]3 X# |& A1 G8 d) T
) d, X9 V( P8 F$ f/ A array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
0 g. h o9 w0 ?) q% a "id" => $shortname."_sponsor_banner_two",
: J6 O# ]- a6 {, [- y4 Z "type" => "textarea",. K" z7 l4 M# n
"std" => "",4 [- n) b% g# ]& ]6 H3 @) x* a
),6 p) B" c& p' }4 k+ o z
& f9 h6 {+ k4 f5 ?$ B& g5 N } array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",! z9 ?7 `. h8 y/ K( B
"id" => $shortname."_sponsor_banner_three",
' i: y; Z d" c8 h "type" => "textarea",
1 e1 _6 H4 G" M; K% \' Q& {8 c3 ] "std" => "",- G- d4 I5 F. L
), ^( Y5 R, m- }4 o; |" S `1 m
4 M* o2 \* |$ Y, t* ~/ r array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",; z+ {1 \9 i7 v* k3 O- j
"id" => $shortname."_sponsor_banner_four",
# c0 J) v* f7 E% b "type" => "textarea",
+ j! F3 H, [ G: t( y* q "std" => "", s5 M" E& |, i7 V7 M& y# {
),# J' q: l4 P) |+ U" o
& C3 r' G5 U8 p: N+ v0 ]9 v% r
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
3 I8 m" Z, f5 d& D; J8 v$ u "id" => $shortname."_sponsor_banner_five",. w% z6 F" g% C; T" n" b4 i! @) ?
"type" => "textarea",
" l( Q# B; r8 K$ C "std" => "",; `$ F' E1 P, p2 ?1 {5 V
),! h m- D6 u; a3 h
0 q! h& z7 D* A: `, w
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
0 C8 g% Q! u2 c. x+ ?/ c7 K "id" => $shortname."_sponsor_banner_six",
0 P4 N. k( t$ F: i2 b+ b "type" => "textarea",5 N6 p2 @3 Q! p1 @
"std" => "",4 x: N1 K. e4 x3 N
),
7 J( N; U: B5 l7 n6 I7 N% O: d2 c5 @ t& ?
array( "name" => "</div></div>",
5 ]8 D/ |2 B. ] "type" => "close",
: ]' O) U( t9 C& f1 L+ p! y, `! N ),7 H. M6 O" w) I8 g
; ~2 X! |0 ?% e+ q+ g1 {( G6 N, ~0 S5 W2 R* Y, ~
- }$ t2 b2 D5 U9 j8 K
);3 _ j: c' m& E, h; D) Q8 D
% s1 r* V1 f$ \" O
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
5 I R) D0 h4 R& H- b. j/ q% t9 Y+ v! _; B; z
echo "<div id=\"admin-options\"> ";
8 M7 m/ ^9 c' i4 R
8 P' L8 ?2 ]! h- gglobal $themename, $shortname, $options;- m; n# e3 M2 u
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';% p- X: Y0 C/ Q2 M6 N9 u
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';8 |& k8 f7 K; q a% s
?>& h Y* t5 }2 e* r, T
+ L. v; u; H4 u! T8 C
<h4><?php echo "$themename"; ?> Theme Options</h4>
" E5 }5 E) Z% L0 e! z1 y0 H5 z3 n2 h6 y. m7 }
<div class="annouce">
+ d' D/ L/ ?) D<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
* F' C' e$ F9 w& I<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>
/ t6 L z( t, ]% _6 V. Q1 e</div>. P& y4 P" [" J8 V4 ~5 p6 u% w
1 s9 @" Q- g; w
<form action="" method="post">
6 ?7 [, Z6 ?: d1 W' L: C7 p9 Z5 G* d
. A. U4 F7 P7 K% m6 L8 p<?php foreach ($options as $value) { ?>) u- h+ U9 h) v0 Y0 _5 X* \5 |' K
2 \0 @ @6 F2 s
<?php switch ( $value['type'] ) { case 'heading': ?>6 W/ ~% M3 w# x& m- z7 ?
# M* h7 y& v B# ~3 ]' n2 u" I<div class="get-option">
1 c/ g: H& I7 C$ i( P# Q9 i; C4 r0 `& S! p2 _+ A
<h2><?php echo $value['name']; ?></h2>& Z( G' b) J& s7 Y
- s$ c4 d4 j! b# r5 ~- [7 M5 T3 d<div class="option-save"> _; Q4 l) C6 E. ~8 H4 e' u, T+ s
: V( m1 N6 j$ T$ K5 b8 Y# S<?php
W# ?4 p3 H- ]4 M1 \/ T* Rbreak;
* D3 y. |0 _" i# X+ c' P I5 Vcase 'text':
& K4 }6 @; G! U2 u/ M. W?>
( {3 L/ c- e1 ^, _0 R
6 h) w& I! r* X* @( P<div class="description"><?php echo $value['name']; ?></div>
e; R$ }! @4 I4 N% N<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
' J9 Y; C# H7 C& f) o! d; v8 D/ O$ B) U: b
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
?8 t2 Z: C' d& A
7 P6 [. G- ]8 w ~% S" o<?php3 Q4 e! Q% A3 W2 l: H1 P
break;9 w% n! Y$ d( B0 P
case 'select':& \1 w, C: t' P% O t* U; t7 U
?># c6 ^/ _! y/ q' a% z. Q) m
1 O. P0 G* B" \; M" v
<div class="description"><?php echo $value['name']; ?></div>. K2 f( q# @+ H2 J& w
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
$ r# |( u$ q$ u<?php foreach ($value['options'] as $option) { ?>
6 F, T4 m; d0 K3 r<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
. T( h5 i4 o- h) v) B<?php } ?>3 m9 w7 P4 u- L+ ^! K0 m
</select>% q) K7 L+ c% i" v
</p>- b7 b0 e& ]* o7 Q5 Q. A1 [8 q; U
. J: }, W" C& p C. f<?php
. \" W# [4 B, g6 u+ ibreak;6 W+ Y Y- ~- a4 h6 n( {
case 'textarea':
) ~+ a/ F0 S* F8 a/ u1 c$valuex = $value['id']; ^5 v/ P0 z; h n# j! E) {8 M
$valuey = stripslashes($valuex);
3 e( x9 u n" H- l; t2 T$video_code = get_settings($valuey);
% w' j8 @% x" u) a4 |/ D?>
) y+ a+ _4 U8 e K3 l' h4 T8 |. Z" S; P4 v" Y! J% S
<div class="description"><?php echo $value['name']; ?></div>' Y0 n6 P& E/ O1 Y8 o( b- L8 ]
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
4 l, w9 Q/ z- w# g# I5 a+ ]# ]7 w- R
else { echo $value['std']; } ?></textarea></p>
; q0 n; H, P5 a$ D7 I7 }$ r0 P9 a* K! @& w
<?php
- i3 T* j7 A- Y- p- e% q6 Obreak;& F3 J+ L, R) J* R) ^+ e9 O) k
case 'close':
- @5 _2 E8 z* x8 r& G8 B: }8 K' ??>( X! v$ N9 h* y. p0 I+ A4 A
; \: v$ f+ Y7 d# H, J5 O% o<div class="clearfix"></div>; T3 s. ~7 }- G- m1 N. e7 z9 G
</div><!-- OPTION SAVE END --># `1 e. R, a8 N9 Q9 S4 a
; i% Q9 X2 X9 a
<div class="clearfix"></div>2 d3 A% N6 g N2 e$ q- e7 n/ y
</div><!-- GET OPTION END -->
( s O C) B3 i; X5 P# C t" _ P# ^8 l
<?php% v7 K3 C- ~6 y, m$ U4 t
break;
$ ~+ R9 t: \0 S4 p0 ~7 X1 y( Wdefault;
" c( e7 e1 l3 x) v. N- y?>
! s9 b# A1 f4 ]2 j; J# P' R! I7 }0 j2 s
( r, E' U+ n% l) ^+ H1 `3 e* S, O
<?php. u0 d' p8 `8 O9 G( {2 J
break; } ?>( O- N; I+ Y2 y: i- m/ {9 A
9 [. s4 G) v( ~9 c8 p% J<?php } ?>1 c% N5 x! v7 V" t3 x
4 l5 x( O/ q/ b' Z<p class="save-p">$ W2 w8 ]# |$ i" I
<input name="save" type="submit" class="sbutton" value="Save Options" />; `3 K& T1 U+ ?1 K' \( R
<input type="hidden" name="action" value="save" />* t$ b8 u! [: w
</p>8 O2 M, L: Q2 B' v
</form>
! |" t5 S0 |- U% k5 O0 P" T: x! ]6 k
2 ]' s6 h' s8 q; w& {! R<form method="post">
5 w' g; L2 w) d- P! @<p class="save-p">
t, X' {4 K. p/ a9 N<input name="reset" type="submit" class="sbutton" value="Reset Options" />! n) Y! [# o f. y' }
<input type="hidden" name="action" value="reset" /># z6 c; O* m+ w' H T: a. C
</p> h6 o8 A% p" I% ?- W
</form>5 _" O, {: @1 C
q, \- f: g7 f8 Y2 X4 P) q
</div><!-- ADMIN OPTIONS END -->
( V5 R/ p9 s' ?. Q5 r( ~
H+ A: d0 X. H, D<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
9 y' d% I- t( Z* P0 i1 j0 m, P z q: ]* W9 T! E- Y' H
function mytheme_admin_register() {
* q+ D: M) C! l. @4 P$ xglobal $themename, $shortname, $options;
1 F2 ]3 p" _4 eif ( $_GET['page'] == basename(__FILE__) ) {8 N0 G ^) g \' ^8 g: v
if ( 'save' == $_REQUEST['action'] ) {
2 D" r% @8 q9 t- C0 D, Q6 Aforeach ($options as $value) {; o, @* U* J! u+ y& P' R g
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
" v' Y( M. u2 M7 M( h, o6 Yforeach ($options as $value) {
" Z3 ~) ]' c6 u; M7 ] J2 d% ]- Xif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }0 J: c5 A' F4 K
header("Location: themes.php?page=functions.php&saved=true");
( a. K/ i/ W. V7 a6 c2 x# s. Ldie;
# n& X- G. p; V2 b) _} else if( 'reset' == $_REQUEST['action'] ) {
. L8 {+ G% F) K* O0 }foreach ($options as $value) {+ C1 N+ z' j# J5 r: ?+ J
delete_option( $value['id'] ); } v3 _# W1 N. T3 |! x4 n3 g
header("Location: themes.php?page=functions.php&reset=true");4 } I! ]. z. I/ J
die;
& }8 @* ]$ @# w& A( @}7 s/ e" S1 o) g$ s7 k* N# X
}1 l8 h* j9 d+ D
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');3 k8 r( l6 Y& [9 B" x
}+ E8 w1 u4 R+ U; J: I
9 W/ ?4 N5 X& E9 T* \3 o& M
function mytheme_admin_head() { ?>+ J$ w1 K. m, ~
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />5 s; R8 E G7 M3 @9 G0 u
<?php }
. y8 D3 f/ A& } |
|