|
|

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