|
|

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