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