|
|

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