|
|

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