|
|

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