|
|

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