|
|

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