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