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