|
|

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