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