|
|

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